Keep symlinks as symlinks when installing packages from local src tree (or bundles)

This fixes #1006.

This is like pull request #1012, which has been sitting there for two months. But this time, I added a test. Shall we merge this now?