gh-162650: Fix tkinter calls from other threads after a nested mainloop() (GH-162651)

A nested mainloop() now restores the dispatching flag instead of resetting
it, so the outer mainloop() still accepts calls from other threads.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed