Facebook was already at the top of the world when it went public in 2012. The IPO nearly ruined it all.