'herbs/memory': Fixed race condition