r111: destroy core.c mutexes when done, and fix a few unlikely memory leaks
r111: destroy core.c mutexes when done, and fix a few unlikely memory leaks

nonolith/libusb,pbatard/libusb-pbatard,nonolith/libusb,pbatard/libusb-pbatard,nonolith/libusb