Disentangling the synchrotron and inverse Compton variability in the X-ray emission of the intermediate BL Lacertae object S5 0716+71