backport ioloopback fixes from upstream