Refactor libusb backend to use sync API
The async API has several issues. Some linux implementation don't
reap URB fast enough and run out of coreusb RAM. Morevover, there
are many edge cases where deadlock can happen, making maintenance
error prone.
Switching to proven legacy architecture (BlockingConnectionAdapte)
fixes these issues.
During the refactor, it was discovered that detach/attach was also
broken. This CL fixes that and add tests for it.
Test: test_device.py
Fixes: 367386707
Fixes: 354870754
Fixes: 372413905
Fixes: 384040413
Change-Id: I526e5df9356acb66371aea0d6d6cea086627e3c8
15 files changed