Glencore is negotiating a long-term contract to ship cobalt to Tesla’s new electric-vehicle factory in Shanghai, according to people familiar with the matter. A deal would help Tesla avoid a supply squeeze on the key battery metal as it pushes into the world’s largest car market, and mark a win for Glencore after a tough spell for its cobalt business.