The US is closing its embassy in Baghdad and the consulate in Erbil and is calling on its staff to leave Iraq immediately.