Mw.reset() update the deck label when it has been deleted

I developed a feature to execute a background task after sync. But it sometime pops up an error when user is closing the collection.

The error:

Anki 23.12.1 (1a1d4d54) (ao)
Python 3.9.15 Qt 6.5.3 PyQt 6.5.3
Platform: macOS-14.3.1-arm64-arm-64bit

Traceback (most recent call last):
File "aqt.taskman", line 142, in _on_closures_pending
File "aqt.taskman", line 86, in
File "/Users/jspear/Library/Application Support/Anki2/addons21/759844606/schedule/reschedule.py", line 171, in on_done
mw.reset()
File "aqt.main", line 851, in reset
File "aqt.main", line 803, in _synthesize_op_did_execute_from_reset
File "_aqt.hooks", line 3840, in call
File "aqt.deckchooser", line 120, in on_operation_did_execute
File "aqt.deckchooser", line 82, in _update_button_label
RuntimeError: wrapped C/C++ object of type QPushButton has been deleted

Logged on Mw.reset() update the deck label when it has been deleted · Issue #3190 · ankitects/anki · GitHub