make `load_library()` panic on some errors when `err=0` (#47343)
load_library with `err=0` now panics on errors, provided that the
file exists. It used to never panic on errors, leading to
confusion between when cases the libjuliacodegen library had been
intentionally removed and when it tried but failed to load it.
Fixes #47027