hash: fix race condition at creation