TrieNode: add a lastDepth parameter to doSearch

We want to record the last success. { "foo", "foobar" } should match "foo" in
"foo ".