Fix various libusb warnings and possible bugs on linux build.