Fix: Prod ID mismatch from issuing Get Device Id

With SUT boot up, "Get Device Id" gives product id "7B 00" which is set
as default value in json file till the time entity manager starts.

The fix shows that until the time entity manager service starts,
product id shows up as "00 00" and not of any other platform's prod id
which is set as default.

Tested:
Ipmitool raw 6  1
23 00 00 22 02 bf 57 01 00 00 00 01 4c ea c7

After entity manager service starts:
Ipmitool raw 6  1
23 00 00 22 02 bf 57 01 00 91 00 01 4c ea c7

Signed-off-by: Joshi, Mansi <mansi.joshi@linux.intel.com>
Change-Id: I9bbe77ecc9fac12389c0bc389f9bdccefd63ca12
diff --git a/src/appcommands.cpp b/src/appcommands.cpp
index 5b29fa7..8fc0d30 100644
--- a/src/appcommands.cpp
+++ b/src/appcommands.cpp
@@ -324,17 +324,18 @@
                         "ProductId");
                     devId.prodId =
                         static_cast<uint8_t>(std::get<uint64_t>(propValue));
+                    dev_id_initialized = true;
                 }
                 catch (std::exception& e)
                 {
-                    devId.prodId = data.value("prod_id", 0);
+                    // For any exception send out platform id as 0,
+                    // and make sure to re-query the device id.
+                    dev_id_initialized = false;
+                    devId.prodId = 0;
                 }
 
                 // Set the availablitity of the BMC.
                 defaultActivationSetting = data.value("availability", true);
-
-                // Don't read the file every time if successful
-                dev_id_initialized = true;
             }
             else
             {