Fix possible naming conflicts in structured TOCs
While the head of the path can refer to a nested node, the rest of the path is now interpreted by always looking up a direct child of the previous node. This fixes odd conflicts when several nested nodes have the same path, although it is still not possible (by design) to have a nested node called something, and then a root node called the same.
Nonexistent nodes (trying to do \tocItem foo.bar before \tocItem foo) are no longer silent, but now emit a warning.
This uses modification of hash tables instead of mutation of alists, so it also happens to fix #6302 (closed), caused by alist pairs being shared.
Fixes #6302 (closed), #6384 (closed)
Edited by Jean Abou Samra