BUG: Raise immediate error in ctypes.load_library when library is bad.

This is a fixup of PR #475 due to JeromeRoy. The problem addressed is
that when multiple errors were encountered attempting to import a
library file, only the last one was preserved. The proposed fix is to
raise an error immediately when a file of the correct name fails to
import, and raise a later error if no file is found but no errors are
raised in the search.

Closes #474, #475.
Merge pull request #3185 from charris/fix-pull-475

BUG: Raise immediate error in ctypes.load_library when library is bad.