The Immigration Dilemma: Avoiding the Tragedy of the Commons