Non-Born–Oppenheimer calculations of the HD molecule in a strong magnetic field