OpenAI CEO Sam Altman has taken the stand in a high-profile trial pitting him against cofounder Elon Musk.