[VOL-2164] Update rw-core to use the Async Kafka API

This commit consists of the following:

1. Process per-device requests in the Core in the order they are
received. If there are lots of requests on a given device then
there will be some latencies introduced due to ordering.  With
recent changes in the model along with keeping the request lock
to a minimal then these latencies are reduced.  Testing did not
show and noticeable latencies.

2) Keep the request lock from the moment a request started
processing to the moment that request is sent to kafka (when
applicable).  Adapter responses are received and processed
asynchronously. Therefore, an adapter can takes all the time it
needs to process a transaction.  The Core still has a context
with timeout (configurable) to cater for cases where the adapter
does not return a response.

3) Adapter requests are processed to completion before sending a
reponse back to the adapter.  Previously, in some cases, a
separate go routine was created to process the request and a
successful response is sent to the adapter.  Now if the request
fails then the adapter will receive an error. The adapter
requests for a given device are therefore processed in the
order they are received.

4) Some changes are made when retrieving a handler to execute
a device state transition.  This was necessary as there was some
transition overlap found.

Update after multiple reviews.

Change-Id: I55a189efec1549a662f2d71e18e6eca9015a3a17
diff --git a/rw_core/mocks/adapter_olt.go b/rw_core/mocks/adapter_olt.go
index 303bae3..f145ab6 100644
--- a/rw_core/mocks/adapter_olt.go
+++ b/rw_core/mocks/adapter_olt.go
@@ -190,7 +190,7 @@
 		cloned := proto.Clone(device).(*voltha.Device)
 		// Update the all ports state on that device to disable
 		if err := oltA.coreProxy.PortsStateUpdate(context.TODO(), cloned.Id, voltha.OperStatus_UNKNOWN); err != nil {
-			log.Fatalf("updating-ports-failed", log.Fields{"deviceId": device.Id, "error": err})
+			log.Warnw("updating-ports-failed", log.Fields{"deviceId": device.Id, "error": err})
 		}
 
 		//Update the device state
@@ -198,7 +198,9 @@
 		cloned.OperStatus = voltha.OperStatus_UNKNOWN
 
 		if err := oltA.coreProxy.DeviceStateUpdate(context.TODO(), cloned.Id, cloned.ConnectStatus, cloned.OperStatus); err != nil {
-			log.Fatalf("device-state-update-failed", log.Fields{"deviceId": device.Id, "error": err})
+			// Device may already have been deleted in the core
+			log.Warnw("device-state-update-failed", log.Fields{"deviceId": device.Id, "error": err})
+			return
 		}
 
 		if err := oltA.updateDevice(cloned); err != nil {
@@ -207,7 +209,8 @@
 
 		// Tell the Core that all child devices have been disabled (by default it's an action already taken by the Core
 		if err := oltA.coreProxy.ChildDevicesLost(context.TODO(), cloned.Id); err != nil {
-			log.Fatalf("lost-notif-of-child-devices-failed", log.Fields{"deviceId": device.Id, "error": err})
+			// Device may already have been deleted in the core
+			log.Warnw("lost-notif-of-child-devices-failed", log.Fields{"deviceId": device.Id, "error": err})
 		}
 	}()
 	return nil
@@ -262,7 +265,8 @@
 
 		if Port.Type == voltha.Port_PON_OLT {
 			if err := oltA.coreProxy.PortStateUpdate(context.TODO(), deviceId, voltha.Port_PON_OLT, Port.PortNo, voltha.OperStatus_DISCOVERED); err != nil {
-				log.Fatalf("updating-ports-failed", log.Fields{"device-id": deviceId, "error": err})
+				// Corresponding device may have been deleted
+				log.Warnw("updating-ports-failed", log.Fields{"device-id": deviceId, "error": err})
 			}
 		}
 	}()