Submegahertz frequency stabilization of a terahertz quantum cascade laser to a molecular absorption line