Refactor some functions in PTPUSB

Makes some functions a bit simpler, and hopefully makes the code overall
easier to read.

Also uses libusb contexts so that we don't need to keep an instance
counter.