Wavelength selection for quantum cascade lasers by cavity length