trie: added a cear_lock function for persistence.