Perform libusb_submit_transfer under the write variant of cgusb_fd_lock
Keep a global counter of how many async usb transfers are in place.
Keep the libusb event handle polling thread active until there are no async usb transfers in progress.
Merge branch 'master' of github.com:ckolivas/cgminer