Coverity issues fixed

Change-Id: I8406c565e99819bea8151d5b4902e7029013b5b6
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
diff --git a/pkg/control/registry.go b/pkg/control/registry.go
index 29d82a9..f9e1bcc 100644
--- a/pkg/control/registry.go
+++ b/pkg/control/registry.go
@@ -530,7 +530,9 @@
 	if waitRouteClean > 0 {
 		// Wait here that response is delivered to xApp via RMR before route is cleaned
 		xapp.Logger.Debug("Pending %v in order to wait route cleanup", waitRouteClean)
+		r.mutex.Unlock()
 		time.Sleep(waitRouteClean)
+		r.mutex.Lock()
 	}
 
 	xapp.Logger.Debug("CLEAN %s", subs.String())
@@ -567,7 +569,10 @@
 
 		// Endpoint of merged subscription is being deleted
 		xapp.Logger.Debug("Subscription route update WriteSubscriptionToDb")
-		c.WriteSubscriptionToDb(subs)
+		err := c.WriteSubscriptionToDb(subs)
+		if err != nil {
+			xapp.Logger.Error("tracker.UnTrackTransaction() failed:%s", err.Error())
+		}
 		c.UpdateCounter(cUnmergedSubscriptions)
 	}
 	return nil