Oxygen and nitrogen uptake during the MBE growth of AlGaAs epitaxial layers