B&G Foods, the US food maker, is to slash its workforce by 7.5% in a bid to cut costs.