Properly handle errors that can occur in the config-loading process
failing test: set global prefix in userconfig
npmconf@1.0.4

Fix #5459