[python] track the open state of the progress dialog, as the open event is sent on-thread, whereas close is sent via a threadmessage. Two progress dialogs in a row thus won't show up if the close of the first occurs after (due to threadmessaging being delayed) the open of the second. Fixes #13467