Make sure an item being renamed is displayed in the tree.

Also makes sure that the item being shown is within the project.
Fix for #9423 and #9487.
Remove unused var (yay JSHint!).
Merge pull request #9620 from adobe/dangoor/9423-rename-invisible

Make sure an item being renamed is displayed in the tree.