core: Allow setting global log callback after first libusb_init()

When setting LIBUSB_OPTION_LOG_CB before the first libusb_init(),
the global callback is set.

However, after the first libusb_init() there is a default context, and
setting LIBUSB_OPTION_LOG_CB would only set this default context, and
not the global callback. There would be no way to set the global
callback through libusb_set_option().

Change this so that the global log callback is set in addition to the
default context (when libusb_set_option is called with NULL context).

Closes #1397
2 files changed