Save unsaved changes window missing missing under special circumstances
<!--
See our full bug reporting guidelines at https://inkscape.org/contribute/report-bugs/
Writing a good bug report will ensure we'll be able to help efficiently. 🙂
-->
#### Summary:
<!-- Summarize the issue/suggestion concisely: -->
This is partially related to inbox#5329. If inbox#5329 is fixed, this probably couldn't be triggered, but still probably should be looked into.
I happened to notice a way to brake the 'Save changes' window that shows up when you close a document that has been modified in the current Inkscape session. Doing the steps below will prevent it from showing up and Inkscape will close instead of showing it when it should.
#### Steps to reproduce:
<!-- Describe what you did (step-by-step) so we can reproduce: -->
1) Open Inkscape
2) Open any file (must open file with an unlocked layer to start).
3) Go into the "Document Properties" window.
4) Click (or un-click) the "Checkerboard background" box under 'Background'.
5) Select any item on the screen and move it.
6) Click undo (Ctrl+Z)
7) Close Inkscape.
#### What happened?
Inkscape closes, even though the * is in the title bar (sometimes it will disappear anyways after Step 6) telling you the document has been modified since you haven't undone the clicking of the "Checkerboard background" box (see inbox#5329).
#### What should have happened?
Inkscape should throw up the 'Save changes' window when you're closing Inkscape due to not undoing the "Checkerboard background" box change yet.
Sample attachments:
<!-- Attach the sample file(s) highlighting the issue, if appropriate. -->
#### Version info
<!--
Open 'Help > About' and click on the little bug icon in the bottom right corner that copies the debug information to your clipboard. For command line users, run 'inkscape --debug-info'.
For Inkscape 1.0.2 and older, please manually add the Inkscape Version and Operating System Version. The Inkscape version is listed in the About dialog. For command line users, run 'inkscape -V'
Paste the information in the empty space between the apostrophes below:
-->
```
Inkscape 1.1 (c68e22c387, 2021-05-23) (64-bit version)
Windows 7 SP1 x64
```
<!--
❤️ Thank you for filling in a new bug report, we appreciate the help! ❤️
Please be patient while we try to find the time to look into your issue.
Remember that Inkscape is developed by volunteers in their spare time, we'll try our best to respond to all reports.
-->
<!--
Please be careful when/after writing # for example in logs, code, or versions of linux
- use inline code span - single backticks (`) before and after it, like this - `inbox#1618`
- use multi-line code block - triple backticks (```) to fence/enclose console logs
- attach long logs as a text file.
-->
issue