Thermal inflation and the gravitational wave background