avoided cond_wait on IO while holding lock