Nitrogen removal with energy recovery through N2O decomposition