Prevent duplicate dynamic linking

This fixes a bug where :r would stop type providers from working.
Merge pull request #480 from david-christiansen/fix-duplicate-libs

Prevent duplicate dynamic linking