Tesla Inc. is plotting a potential lithium refinery on the gulf coast of Texas, a move that would bolster the company’s battery-production efforts and further expand its footprint in the state.