VOL-2092: Fix empty id reference in delete statement

Amendments:

- Removed changes that are no longer required

Change-Id: I3f7982f255a6091a8ed9fd7e56561914eb418cc7
diff --git a/rw_core/core/logical_device_manager.go b/rw_core/core/logical_device_manager.go
index b3f313c..035d366 100644
--- a/rw_core/core/logical_device_manager.go
+++ b/rw_core/core/logical_device_manager.go
@@ -192,8 +192,8 @@
 		if ldAgent.rootDeviceId == id {
 			log.Infow("stopping-logical-device-agent", log.Fields{"lDeviceId": key})
 			ldAgent.stop(nil)
-			ldMgr.logicalDeviceAgents.Delete(ldId)
 			ldId = key.(string)
+			ldMgr.logicalDeviceAgents.Delete(ldId)
 		}
 		return true
 	})