Fix: "pip install ." fails on Python 3.3 (with symlinks in local directory)

This pull request (hopefully) fixes GitHub issue #1006, and includes a separate test case for the issue.