[gui] Merged PR from furszy: Fix crash when closing wallet https://github.com/bitcoin-core/gui/pull/835