Fix 'r' key to properly find an open node when the active node is tagged,
or when a node had tags additionally to tags that mean "end".
tree_util: avoid creating a new list for no reason.