Keep symlinks as symlinks when installing

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?