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 sending "close window" messages to the wrong windows.