loopdev: fix a deadlock