EU agrees to rely on Afghanistan's neighbours to avoid migrant crisis