Run tkwait visibility on initial toplevel window only after the event loop has started, to avoid window flickering on initial window resize by the user code.