Vungle was almost a bungle, but after a private-equity buyout and merger, it could be headed for a $400 million IPO.