[snapshot/restore] Make sure that snapshot continues to be processed correctly if master node closes during operation