Higher wheat, maple syrup and corn costs have weighed on half-year profits at US food group B&G Foods.