Fixed race condition in TransactionalQueue()

Fixed https://github.com/yandex-sysmon/gns/issues/126