A Swiss vote on capping the population at 10 million has become a test of immigration and national identity.