Fix segfault crash when shutdown the GUI in disablewallet mode
Fix segfault crash when shutdown the GUI in disablewallet mode

Github-Pull: #9817
Rebased-From: 312c4f10574ccf6dfe0d4ecb3ce928733d3a1e52

magacoin/magacoin,magacoin/magacoin,magacoin/magacoin,magacoin/magacoin,gravio-net/graviocoin,magacoin/magacoin,gravio-net/graviocoin,gravio-net/graviocoin,gravio-net/graviocoin,gravio-net/graviocoin,magacoin/magacoin,gravio-net/graviocoin