security: Fix bug preventing customization of KeyChain's TPM on macOS

Implementation incorrectly assumed that default PIB and TPM locators are
in canonical form, potentially leading to an wrong decision to reset
contents of PIB every time KeyChain is initialized.

Change-Id: I8b30f3aa2ac74e859e9225cf03b2b43af27d7d76
Refs: #4297
diff --git a/src/security/v2/key-chain.cpp b/src/security/v2/key-chain.cpp
index 348f214..2ac2e99 100644
--- a/src/security/v2/key-chain.cpp
+++ b/src/security/v2/key-chain.cpp
@@ -116,6 +116,10 @@
     s_defaultPibLocator = config.getParsedConfiguration().get<std::string>("pib", getDefaultPibScheme() + ":");
   }
 
+  std::string pibScheme, pibLocation;
+  std::tie(pibScheme, pibLocation) = parseAndCheckPibLocator(s_defaultPibLocator);
+  s_defaultPibLocator = pibScheme + ":" + pibLocation;
+
   return s_defaultPibLocator;
 }
 
@@ -133,6 +137,10 @@
     s_defaultTpmLocator = config.getParsedConfiguration().get<std::string>("tpm", getDefaultTpmScheme() + ":");
   }
 
+  std::string tpmScheme, tpmLocation;
+  std::tie(tpmScheme, tpmLocation) = parseAndCheckTpmLocator(s_defaultTpmLocator);
+  s_defaultTpmLocator = tpmScheme + ":" + tpmLocation;
+
   return s_defaultTpmLocator;
 }