[ONOS-6462] Intent stuck in WITHDRAWING state with FlowObjective intent compiler

Reasons makes Intent stuck in WITHDRAWING state:
1. The patch for CORD-1180 caused next objective queued in the objective
system if there is no next group for that next objective.

2. Default single table pipeline removes next group from flow objective
store when removing forwarding objective.

3. The flow objective Intent installer will remove forwarding objective
first, then remove next objective.

4. The flow objective Intent install will wait until all objective context
completed, however, according to reason 1, 2 and 3, the next objective
will be queued forever since there will be no next group in the store. So
the Intent state will stuck in WITHDRAWING until the Intent manager retry.

To fix this issue, we need to modify default single table pipeline, make it
not remove next group when removing forwarding objective.

Change-Id: Ia51a3361f19b60332ca1a276583cdfc036d93343
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java
index 426f36c..358fea5 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/DefaultSingleTablePipeline.java
@@ -185,7 +185,7 @@
             } else {
                 // We get the NextGroup from the remove operation.
                 // Doing an operation on the store seems to be very expensive.
-                next = flowObjectiveStore.removeNextGroup(fwd.nextId());
+                next = flowObjectiveStore.getNextGroup(fwd.nextId());
                 if (next == null) {
                     fwd.context().ifPresent(c -> c.onError(fwd, ObjectiveError.GROUPMISSING));
                     return;
@@ -254,6 +254,12 @@
                 );
                 break;
             case REMOVE:
+                NextGroup next = flowObjectiveStore.removeNextGroup(nextObjective.id());
+                if (next == null) {
+                    nextObjective.context().ifPresent(context -> context.onError(nextObjective,
+                                                                                 ObjectiveError.GROUPMISSING));
+                    return;
+                }
                 break;
             default:
                 log.warn("Unsupported operation {}", nextObjective.op());