Elon Musk has spent more than $442 million backing Republican candidates and political groups ahead of the US midterm elections.