Fix possible NPE in snapshot/restore during node shutdown