Convert the usb callback function to use a cgsem_t using the timedwait code to avoid races with mutexes/conditionals.