Iraq declares end of caliphate after capture of historic Mosul mosque