kernel - Fix condvar races