fixed erreoneous binding set to window close event listener
Combine the _onWindowClose tests into one for the event to test the result of the event and not the event and function separately.
Merge pull request #241 from n1k0/fix-erroneous-binding

Fixed erreoneous binding set to window close event listener