The merger of social media platform X with Musk’s artificial intelligence start-up xAI will allow him, his co-investors and X’s banks to exit the struggling business unscathed.