Migrant crisis between Morocco and Spain was behind the flight’s emergency landing