Follow symlinks for library scan.

Fixes #1953