Sometimes an application has other windows open, like the open panel. Even when these are closed they seem to live on in the application's window array. We now ignore those windows when trying to terminate the app. Closes #534