trie: added lock and unlock ops.