Fix use of QMutex for Qt5 mutex semantics

This series cleans up the remaining uses of QMutex in the usb transport. The old code did things with mutexes that are not allowed in Qt5 (such as unlocking them more than once, or locking them in one thread and then unlocking in another). I've also reviewed the thread safety in general.

The main remaining issue is reliably shutting down the IO threads. I'll leave that for later.

As of this commit I can run mtp_service on the device and see it with mtp-detect on the host. I can also mount it with simple-mtpfs and look at pictures and copy new pictures to the device. There is one glitch though, when I start any of the mtp tools on the host there will be a timeout and then a USB reset and then it works. I've stared at strace output for mtp_service and I think it's a problem in the kernel, since mtp_service doesn't see any activity on the endpoints until it gets an ESHUTDOWN from the USB reset.