French retailer Carrefour has signed up to a government-backed pledge to cut food waste.