A single dose of vaccine boosts protection against SARS-CoV-2 coronavirus variants, but only in those with previous COVID-19, a study has found.