core: Improve the handling of the pollfd list
This change consists of two parts that must be taken together.
Part 1 moves the pollfd list under the protection of event_data_lock
and eliminates the pollfd_lock. Since modifications to the pollfd
list are considered an event, it makes sense to merge this. Another
benefit of doing so is an enhancement to event handling. The event
handler can get the updated pollfd list upon entry into handle_events()
and can clear the event pipe if no other pending events exist, which
saves a needless iteration.
Part 2 makes notification of pollfd list changes part of adding or
removing a pollfd from the list. Previously this was done in two
distinct steps, however nothing prevented a new pollfd from being
used by an event handler before an explicit notification was sent out.
This change eliminates the need for USBI_TRANSFER_UPDATED_FDS and
reverts
9a9ef3ec2b9c691609ec9f8b82ac4436a662df18.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>