The expected number of people who pull their own names turns out to be exactly 1, independent of the number of people. You can see this value by computing the following expression inside the loop:

e[i] = sum(cnt) / nperms;

For a nice derivation of this expected value, consider that each person pulls his or her own name with probability 1/N.

A related question: what is the probability that exactly N - 1 people pull their own names?