macos: Fix Zero-Length Packet for multiple packets per frame

Summary of problem:

The LIBUSB_TRANSFER_ADD_ZERO_PACKET flag does not work as expected on
Darwin. On my USB 3 device, with maxPacketSize = 1024, I see libusb
sending ZLP for packets multiple of 5120 instead of 1024.

The ZLPs are not being sent when they should because
darwin_get_pipe_properties() retrieve the "full" wMaxPacketSize via
GetPipePropertiesV3(), which includes bandwidth multipliers.

Summary of solution:

GetEndpointPropertiesV3() does retrieve unaltered wMaxPacketSize,
without multipliers. To call it, we first use GetPipePropertiesV3() to
set the fields required.

Fixes #1581
Closes #1582
2 files changed