Fix for hanging aborted snapshot during node shutdown

If a node is shutdown while a snapshot that runs on this node is aborted, it might cause the snapshot process to hang.

Closes #5958