Adsorption and Reaction of CO and CO2 at the Surface and Defect Sites of MgO and NiO