core: Improve robustness of event handling
Prior to this commit, it was possible on Linux to poll a file descriptor
that was not valid for libusb. This could happen given the following
sequence of events:
1) Application registers hotplug callback
2) Application calls into libusb to handle events
3) USB device is unplugged, triggering hotplug event
4) Event handling thread calls registered hotplug callback
5) Hotplug callback calls libusb_close(), which closes the fd
6) Event handling code retries the poll() call before returning
At this point, the file descriptor that is being passed to poll() may be
invalid or worse may not belong to libusb at all.
This commit fixes this by removing the code that restarted the poll() call.
It was originally added to allow the processing of multiple hotplug messages
when these messages were delivered across a pipe, but with a linked list now
holding the hotplug messages this is no longer a concern. If any hotplug
messages are present on the list, they are all processed in one pass.
Closes #238
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>