Turkey has agreed to gradually withdraw forces from a strategic military base in northern Iraq and hand over control to the Iraqi government