OpenAI’s for-profit arm finalized its conversion into a public-benefit corporation and reached a deal with Microsoft that will see the tech giant take a 27% stake.