Toyota has sold all of its shares in Tesla as it shapes up to rival Elon Musk's electric car start-up.