Thermal relics in cosmology with bulk viscosity