Impact of pump wavelength on terahertz emission of a cavity-enhanced spintronic trilayer