Elon Musk delivered combative testimony in federal court as he continued his case against OpenAI and CEO Sam Altman.