The U.S. military has formally shut down the war in Iraq, officially retiring the flag of U.S. Forces-Iraq.