Meta is creating a new class of shares to fund its AI initiatives as it pours billions into the industry.