Mac fixes
When combined with libusb 1.0.27 (which fixes https://github.com/libusb/libusb/issues/919), this should fix all the issues I've found with macOS scanning (e.g. #565). IMO these changes should be low-risk to include in the upcoming release as they are only applicable to macOS, which is (without these changes) fully broken.