M-shell electron capture and direct ionization of gold by 25-MeV carbon and 32-MeV oxygen ions