fix bug in deleting notes

Hi, thanks for making the trie module available. I am using it in an open-source chess server I am writing. I have found a bug in the deletion of trie entries. I know you released trie years ago, so I am not sure if you are still interested, but I spent a couple of hours debugging to find the problem, and thought this might save someone else from running into the same bug. Thanks again.