Charge-exchange cross sections of nearly fully stripped 16O ions in solid targets