Ankara agrees to gradually hand over a base in Sinjar.