Britain's Tom Pidcock defied a puncture to retain his Olympic mountain bike title in astonishing fashion in Paris.