Tesla’s top engineering exec, who led development of critical technologies, has resigned after 18 years, adding to concerns about who will succeed Elon Musk as CEO