The Delaware judge steering the lawsuit over Twitter Inc. and Elon Musk’s stalled $44 billion takeover said the billionaire chief executive of Tesla Inc. can amend his countersuit to incorporate allegations from a whistleblower complaint by the social-media company’s former head of security.