Inhibition of the corrosion of iron by oxygen and nitrogen containing compounds