Ran into an issue using libimobiledevice tools locking up with a iOS device connected with a faulty USB cable and tracked it down to libusbmuxd and libimobiledevice-glue.
Code linked against the Windows MSVC runtime library using its send(), recv(), and select() functions can return on a hard disconnect or connection reset with errno set to 0.
One possible workaround would be to replace returns of -errno with (errno == 0) ? -ECONNRESET : -errno