Fix persist configuration changes from user

There are user commands that can modify system configuration, like
sensor thresholds. These changes are expected to persist through power
cycles until they are changed again or factory reset is performed.

Issue: these changes are not persistent because the cached system.json
gets overwritten by perform_scan's updateSystemConfiguration with old
json record. Check if the device already exist in current system json
before loading record from last saved configuration.

Tested:
ipmitool commands to change sensor threshold and the change persist
across power cycles.

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: I160d1910c9b3559558c6a1c3b1b10a454879ae3d
diff --git a/src/perform_scan.cpp b/src/perform_scan.cpp
index 559b822..f87965a 100644
--- a/src/perform_scan.cpp
+++ b/src/perform_scan.cpp
@@ -483,19 +483,22 @@
     {
         std::string recordName = getRecordName(itr->interface, probeName);
 
-        auto record = lastJson.find(recordName);
-        if (record == lastJson.end())
+        auto record = _systemConfiguration.find(recordName);
+        if (record == _systemConfiguration.end())
         {
-            itr++;
-            continue;
+            record = lastJson.find(recordName);
+            if (record == lastJson.end())
+            {
+                itr++;
+                continue;
+            }
+
+            pruneRecordExposes(*record);
+
+            recordDiscoveredIdentifiers(usedNames, indexes, probeName, *record);
+
+            _systemConfiguration[recordName] = *record;
         }
-
-        pruneRecordExposes(*record);
-
-        recordDiscoveredIdentifiers(usedNames, indexes, probeName, *record);
-
-        // keep user changes
-        _systemConfiguration[recordName] = *record;
         _missingConfigurations.erase(recordName);
 
         // We've processed the device, remove it and advance the