security: avoid parsing PIB and TPM locators multiple times

Change-Id: I2a8831e03d05b499f1f8939e03ea88cb82005743
diff --git a/tests/test-home-fixture.hpp b/tests/test-home-fixture.hpp
index 3d4f056..3e3673f 100644
--- a/tests/test-home-fixture.hpp
+++ b/tests/test-home-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2021 Regents of the University of California.
+ * Copyright (c) 2013-2022 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -77,8 +77,7 @@
     }
 
     boost::filesystem::remove_all(m_pibDir);
-    const_cast<std::string&>(KeyChain::getDefaultPibLocator()).clear();
-    const_cast<std::string&>(KeyChain::getDefaultTpmLocator()).clear();
+    KeyChain::resetDefaultLocators();
   }
 
 protected: