UPSTREAM: usb_get_port_path(): fix libusb error checking

When libusb cannot access a device, libusb_get_port_numbers() will return
an error. Check the return code rather than doing invalid pointer
operations (out-of-bound read).

Avoid segfaults at sigrok-cli startup on my setup where some USB devices are
not accessible and also make Valgrind happier.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 2f004b4bc15c891b474adcba59a2224f009828af)

BUG=none
BRANCH=none

Change-Id: I41ccfba32a831b8d18be14439a3a06169dd6febb
1 file changed