The move by TotalEnergies has so far helped avert mass protests, as surging profits make it a target for a windfall tax.