Real-time electron dynamics simulation of the adsorption of an oxygen molecule on Pt and Au clusters