[VOL-4931] openoltAdapter: memory leak seen in long term tests

This patch is a prerequisite for changes in the openoltAdapter to eliminate memory leaks and must be merged first.

Change-Id: I2e35407aac20047312fe3cf8b1c345396e6a4bd3
diff --git a/pkg/techprofile/tech_profile.go b/pkg/techprofile/tech_profile.go
index 6d68f5a..dce43ed 100644
--- a/pkg/techprofile/tech_profile.go
+++ b/pkg/techprofile/tech_profile.go
@@ -178,6 +178,21 @@
 	*/
 }
 
+func (t *TechProfileMgr) CloseKVClient(ctx context.Context) {
+	if t.config.KVBackend != nil {
+		t.config.KVBackend.Client.Close(ctx)
+		t.config.KVBackend = nil
+	}
+	if t.config.DefaultTpKVBackend != nil {
+		t.config.DefaultTpKVBackend.Client.Close(ctx)
+		t.config.DefaultTpKVBackend = nil
+	}
+	if t.config.ResourceInstanceKVBacked != nil {
+		t.config.ResourceInstanceKVBacked.Client.Close(ctx)
+		t.config.ResourceInstanceKVBacked = nil
+	}
+}
+
 func NewTechProfile(ctx context.Context, resourceMgr iPonResourceMgr, kvStoreType string, kvStoreAddress string, basePathKvStore string) (*TechProfileMgr, error) {
 	var techprofileObj TechProfileMgr
 	logger.Debug(ctx, "initializing-techprofile-mananger")