CMA CGM swings to profit on higher rates