Fix segfault in TM finalize action

(cherry picked from commit 6cee0680b92787bc25f6a32f3a9df411f088d81c)
Bug #2440: Images to be saved-as are only set to ready if the VM is shutdown correctly (epilog phase)

(cherry picked from commit b07e876fb1ea4fad6ab2075206dac4deddf2f2d1)