Tesla sales have declined in the first three months of the year, in a sign that Elon Musk’s once-high-flying electric car company is struggling to attract buyers.