Carrefour reported a fall in half-year profits but shares in the French retail giant rose as analysts had expected a steeper decline.