Elon Musk and Sam Altman, who were longtime friends and helped start OpenAI, are in an extended legal battle that now involves Apple.