PEL: Clear PLDM instance IDs in certain cases

When the host powers off or the code hits the maximum amount of retries
after a failure and gives up, call the PLDM interface's cancelCmd
function to ensure that the code will get a new instance ID on any
future attempts at sending a PEL to the host.

Note that in the power off case the PLDMInterface class would only have
an instance ID around if it was in the middle of sending a command at
the time.

It is doing this because there is no way to know when the next attempt
at sending up a PEL will occur, it could be months or years, and it
can't assume the PLDM daemon will not have already given that ID to
someone else by then.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I6cd5ef6131ee0b2a205fcf71db5a2bfaa2e44e36
diff --git a/extensions/openpower-pels/host_notifier.cpp b/extensions/openpower-pels/host_notifier.cpp
index 566edda..175a644 100644
--- a/extensions/openpower-pels/host_notifier.cpp
+++ b/extensions/openpower-pels/host_notifier.cpp
@@ -222,6 +222,10 @@
             log<level::ERR>(
                 "PEL Host notifier hit max retry attempts. Giving up for now.",
                 entry("PEL_ID=0x%X", _pelQueue.front()));
+
+            // Tell the host interface object to clean itself up, especially to
+            // release the PLDM instance ID it's been using.
+            _hostIface->cancelCmd();
         }
         return;
     }
@@ -362,10 +366,8 @@
         _retryTimer.setEnabled(false);
     }
 
-    if (_hostIface->cmdInProgress())
-    {
-        _hostIface->cancelCmd();
-    }
+    // Ensure the PLDM instance ID is released
+    _hostIface->cancelCmd();
 }
 
 void HostNotifier::ackPEL(uint32_t id)