By closing their frontiers to migrants, rich countries risk destabilizing important nations across the globe.