libusb: Emit event after deregistering hotplug handler
The original implementation did not emit an event when a hotplug handler
was deregistered. This omission causes issues for programs that follow
the best practices recommended by libusb—particularly those that use
libusb_hotplug_register_callback() or similar functions in a loop
while managing hotplug handlers dynamically.
Without emitting an event after deregistration, these programs can
become stuck waiting indefinitely for an event that will never come,
as the condition to break out of the wait loop is never satisfied.
See: https://github.com/libusb/libusb/blob/6c0ae1ab456da49e7805115e77ce0428ace4ea41/libusb/hotplug.c#L459
Reviewed by: bapt
Sponsored By: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50170