The French oil and gas company Total has managed to offset the effects of weak commodity prices by reporting better-than-expected profits in the third quarter of 2016.