kontrol: fix race conditions