oem: ibm: Assemble the image in a forked process

The assembling of the tarball image file is a long running process,
causing pldm to not reply to any other requests until it's done, causing
errors such as when the hypervisor tries to ping the bmc to determine if
it's running.

Move the assembling of the image to a forked process so that it runs in
the background. Move the assembling function to the code update class so
that it has access to the code update sensor to set it to error if an
failure occurs, since no parent process will wait for it.

Use double fork to avoid zombie tasks, this allows the grandchild to be
reparented to init.

Tested: Verified the hypervisor did not reset the BMC during an inband
update because it didn't receive a reply to its ping request.

Change-Id: I47d5fde1a1311e94d5b03f7fcf4c0ab15ba054e3
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index 582a3df..fec9ec7 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -390,7 +390,7 @@
     sdeventplus::source::EventBase& /*source */)
 {
     assembleImageEvent.reset();
-    int retc = assembleCodeUpdateImage();
+    int retc = codeUpdate->assembleCodeUpdateImage();
     if (retc != PLDM_SUCCESS)
     {
         codeUpdate->setCodeUpdateProgress(false);