Noise mitigation techniques for high-precision laser spectroscopy and integrated photonic chemical sensors