revert more of r9529
better fix for issue 2729
add another SetFocus() after calling CloseDocumentInTab() in CloseWindow()
fix crashy edge case in OnMenuRenameFile