Prevent duplicate tree nodes when renaming the only file in a directory

Use jstree open_node in corner case #6474 where renaming the only file in a directory caused duplicate tree nodes to appear