Patch from Rob Gagnon, backport of test fix from master. Resolves LIBZMQ-462
Merge pull request #78 from ianbarber/master

Backport of test_last_endpoint shutdown fix, resolves LIBZMQ-462