Britain has officially handed over its Iraq headquarters to the US as troops prepare to leave the country.