fix: wait for window creation no matter if on main thread (#15508)