Identify the main Brackets window the right way

This fixes [#3047](https://github.com/adobe/brackets/issues/3047).  The old code was on the wrong assumption that the first item in the window map is always the main window and therefore we were sometimes sending "close window" messages incorrectly to the main window.