PM / Hibernate: Refactor and simplify hibernation_snapshot() code