Fix Cache Removal listener

- Removal lister will be called even if the entry was manually
  invalidated. Timeout handler should check for the cause.

Note: In both of the cases fixed in this patch, Future should silently ignore
  setException, external behavior-wise no change by this patch.

Change-Id: Id46f23c9ff8dfa607874cfd94807000f03a95b31
diff --git a/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java b/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
index ae646b6..b611fad 100644
--- a/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
+++ b/utils/netty/src/main/java/org/onlab/netty/NettyMessagingService.java
@@ -72,7 +72,9 @@
             .removalListener(new RemovalListener<Long, SettableFuture<byte[]>>() {
                 @Override
                 public void onRemoval(RemovalNotification<Long, SettableFuture<byte[]>> entry) {
-                    entry.getValue().setException(new TimeoutException("Timedout waiting for reply"));
+                    if (entry.wasEvicted()) {
+                        entry.getValue().setException(new TimeoutException("Timedout waiting for reply"));
+                    }
                 }
             })
             .build();