VOL-2867 - Removed unnescessary proto.Clone() in getDevice() and getLogicalDevice().

Also renamed getDevice() to getDeviceReadOnly(), getLogicalDevice() to getLogicalDeviceReadOnly(), and getDeviceReadOnly() to getDeviceReadOnlyWithoutLock().
Callers of *ReadOnly() functions must not modify the returned structures.
Also fixed places where lock was not acquired before calling getDevice().
Related to VOL-3356.

Change-Id: I9913a76a497c4d977457edaea3b199a24a3a5cb8
diff --git a/rw_core/core/device/agent_group.go b/rw_core/core/device/agent_group.go
index da2b7c5..96254e4 100644
--- a/rw_core/core/device/agent_group.go
+++ b/rw_core/core/device/agent_group.go
@@ -50,7 +50,10 @@
 		return coreutils.DoneResponse(), nil
 	}
 
-	device := agent.getDeviceReadOnly()
+	device, err := agent.getDeviceReadOnly(ctx)
+	if err != nil {
+		return coreutils.DoneResponse(), status.Errorf(codes.Aborted, "%s", err)
+	}
 	dType, err := agent.adapterMgr.GetDeviceType(ctx, &voltha.ID{Id: device.Type})
 	if err != nil {
 		return coreutils.DoneResponse(), status.Errorf(codes.FailedPrecondition, "non-existent-device-type-%s", device.Type)
@@ -128,7 +131,10 @@
 		logger.Debugw(ctx, "nothing-to-delete", log.Fields{"device-id": agent.deviceID})
 		return coreutils.DoneResponse(), nil
 	}
-	device := agent.getDeviceReadOnly()
+	device, err := agent.getDeviceReadOnly(ctx)
+	if err != nil {
+		return coreutils.DoneResponse(), status.Errorf(codes.Aborted, "%s", err)
+	}
 	dType, err := agent.adapterMgr.GetDeviceType(ctx, &voltha.ID{Id: device.Type})
 	if err != nil {
 		return coreutils.DoneResponse(), status.Errorf(codes.FailedPrecondition, "non-existent-device-type-%s", device.Type)
@@ -184,7 +190,10 @@
 		return coreutils.DoneResponse(), nil
 	}
 
-	device := agent.getDeviceReadOnly()
+	device, err := agent.getDeviceReadOnly(ctx)
+	if err != nil {
+		return coreutils.DoneResponse(), status.Errorf(codes.Aborted, "%s", err)
+	}
 	if device.OperStatus != voltha.OperStatus_ACTIVE || device.ConnectStatus != voltha.ConnectStatus_REACHABLE || device.AdminState != voltha.AdminState_ENABLED {
 		return coreutils.DoneResponse(), status.Errorf(codes.FailedPrecondition, "invalid device states-oper-%s-connect-%s-admin-%s", device.OperStatus, device.ConnectStatus, device.AdminState)
 	}