The host galaxies of flat-spectrum quasars