Wavelength-dependent UV photodesorption of pure N2 and O2 ices