related: https://github.com/spesmilo/electrum/issues/6889 This fixes the case where the user quits by pressing Ctrl+C, and some other minor things. There is still another issue that sometimes causes a segfault during shutdown...