Measurements of fixed-charge and charge-changing contributions to stopping for 3 MeV/u C and O ions in C foils