make app close button confirm exit like Ctrl+Q

Currently, unlike the Ctrl+Q key combination, the application close button does not confirm exit from the user. This PR fixes that by making the close button do the same thing that Ctrl+Q does.