Improvements in code to avoid proper cleanups on DeleteDevice call

- Stop onu indication channels before invoking DeleteDevice call towards
the OLT. This is to ensure that we stop processing on the channels
irrespective of failure to reach the device for DeleteDevice call.
- Process cleanup on DB in a synchronous manner so that core is inimated
of delete device success only after all the cleanup is completed at the
adapter

Change-Id: I9bf27cd4bf9035da366490c945f8344df8e8741a
diff --git a/internal/pkg/resourcemanager/resourcemanager.go b/internal/pkg/resourcemanager/resourcemanager.go
index 737f694..c256a3d 100755
--- a/internal/pkg/resourcemanager/resourcemanager.go
+++ b/internal/pkg/resourcemanager/resourcemanager.go
@@ -474,13 +474,18 @@
 
 // FreeonuID releases(make free) onu id for a particular pon-port
 func (rsrcMgr *OpenOltResourceMgr) FreeonuID(ctx context.Context, intfID uint32, onuID []uint32) {
-
+	if len(onuID) == 0 {
+		logger.Info(ctx, "onu id slice is nil, nothing to free")
+		return
+	}
 	if err := rsrcMgr.PonRsrMgr.TechProfileMgr.FreeResourceID(ctx, intfID, ponrmgr.ONU_ID, onuID); err != nil {
 		logger.Errorw(ctx, "error-while-freeing-onu-id", log.Fields{
 			"intf-id": intfID,
 			"onu-id":  onuID,
 			"err":     err.Error(),
 		})
+	} else {
+		logger.Infow(ctx, "freed onu id", log.Fields{"intfID": intfID, "onuID": onuID})
 	}
 
 	/* Free onu id for a particular interface.*/