Protect against exceptions thrown in application's packet processors.

These exceptions should not bubble up to netty because that will result in the
connection to the switch being closed.

For now we catch and log the exception - in the future we could consider removing
misbehaving packet processors.

Addresses ONOS-3368.

Change-Id: If507adafba39bf705c27286c8e48af3f955d1eff
diff --git a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
index 8e87a07..793030f 100644
--- a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
+++ b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
@@ -312,9 +312,13 @@
         public void processPacket(PacketContext context) {
             // TODO filter packets sent to processors based on registrations
             for (ProcessorEntry entry : processors) {
-                long start = System.nanoTime();
-                entry.processor().process(context);
-                entry.addNanos(System.nanoTime() - start);
+                try {
+                    long start = System.nanoTime();
+                    entry.processor().process(context);
+                    entry.addNanos(System.nanoTime() - start);
+                } catch (Exception e) {
+                    log.warn("Packet processor {} threw an exception", entry.processor(), e);
+                }
             }
         }