Disconnecting the `wallet' during `node' snapshot

When I take a snapshot on a node with a connected wallet communication is interrupted. Snapshot turns off, saves state, then turns on node. At this point, the wallet loses connection (Assert Exception: websocket send failed: invalid state). There is a workaround this problem:

    wallet.close()
    node.dump_snapshot()
    wallet.run()

But it is a cumbersome during create tests. The node should check that the wallet is connected to it (during the snapshot) and perform a wallet restart internally.