The Islamic State’s bloody defeat in Mosul