US President Trump's threats come as Iraq backs a resolution calling for US troops to leave the country.