Kinetic isotopic fractionation and the origin of HDO and CH3D in the solar system