Usb fixes

This pulls in a number of fixes to USB tested by Andrew Tridgell and Julian Oes and contributed by Andrew Tridgell and (mostly) Petteri Aimonen.