Make trie_free and trie_free_only work for null