[LinkingContext] Limit shared library undefined atoms to be added.

This adds functionality to limit shared library undefined atoms to be added
only once by the Resolver.

Dynamic libraries may be processed more than once if they exist within a
Group.

Also adds a test to verify the change.