Stabilisation of single-longitudinal mode operation in a Q-switched Nd:YAG laser