Time-resolved intensity and spectral changes in a wide-ridge terahertz quantum cascade laser by optical pulse injection