Terahertz spectroscopy for space applications: 2.5–2.7 THz spectra of HD, H2O and NH3