Change logic for deleting logs.

Completed logs are now deleted when they have been incorporated into the image. Therefore the current log will always be backed up during a failover but will not be during the first image write.