The sale caps a remarkable turnaround for Hostess, which has been through two Chapter 11 bankruptcies.