Elon Musk testified, calling himself a fool for funding OpenAI, as a trial examines its shift from nonprofit to for-profit.