Measurement of the neutron and proton structure functions from neutrino and antineutrino scattering in deuterium