Private-equity firm Permira is to buy US snacks firms Medora Snacks and Ideal Snacks Holding.