TreeHouse Foods has said that its profits doubled in the second quarter, boosted by higher sales at its retail grocery unit.