Elon Musk has been warned he must protect Twitter users from harmful content after he struck a $44bn deal to buy the social media giant.