Study of the output pulse stability of a cascaded high-gain harmonic generation free-electron laser