In case of a failure to create the dump, the node should not be left in an inconsistent state like deactivated network activity or an invalidated blockchain.
This concludes backport of core#30817
https://github.com/bitcoin/bitcoin/pull/30817/commits/4b5bf335adabd1586043caa72a98356a8255bc29
Depends on D18049