Improve handling of simultaneous rlibs and dylibs

The first commit improves error messages during linking, and the second commit improves error messages during crate-loading time.

Closes #12297
Closes #12377