BMC: Fix the delete implementation.

- Implement delete interface inside version class
  so that both item_updater and image_manager can
  share the same interface. This meant removing the
  delete interface from inside the activation class.
- The delete is created as a separate object inside
  version, only if the image is non-functional.
  This helps remove the delete interface from a
  running BMC/HOST image.
- As part of the activation process, the version from
  inside the image_manager is deleted and so is the
  version's tarfile from the image upload dir.

Partially resolves openbmc/openbmc#2490

Change-Id: Ib35bf188df85ebd2277d3d9ad04300e434965eea
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/version.cpp b/version.cpp
index 6377afb..724ffea 100644
--- a/version.cpp
+++ b/version.cpp
@@ -124,6 +124,14 @@
     return versionStr == getBMCVersion(OS_RELEASE_FILE);
 }
 
+void Delete::delete_()
+{
+    if (parent.eraseCallback)
+    {
+        parent.eraseCallback(parent.getId(parent.version()));
+    }
+}
+
 } // namespace manager
 } // namespace software
 } // namepsace phosphor