Buffer gas cooling of ions in radio-frequency traps using ultracold atoms