Core: Handle TRANSFER_ERROR/TRANSFER_CANCELLED for sync transfers

* Return the more appropriate LIBUSB_ERROR_IO instead of
  LIBUSB_ERROR_OTHER for the cases LIBUSB_TRANSFER_ERROR and
  LIBUSB_TRANSFER_CANCELLED
* Fixes warnings similar to the following when using the GCC
  option -Wswitch-enum:
  warning: enumeration value ‘LIBUSB_TRANSFER_ERROR’ not handled in switch
2 files changed