Tesla boss Elon Musk is set to go on trial after he described a British cave explorer who helped rescue a group of boys from a cave complex in Thailand as a paedophile on Twitter.