ONOS-6468 Fix for race condition between compilation and installation complete state.

- Fix for a bug where intent compilation complete state,
  can overwrites intent installation complete state,
  if intent installation completes before compilation complete state is written to the store.
  - Introduced internalState version on IntentData,
    which is effectively mutation count, in order to avoid
    batch write of compilation result overwriting installation result

Change-Id: I5d77dfbe496e690ebdf2b4f9643d2b64c4233182
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/Failed.java b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/Failed.java
index 0a05e4f..26ba858 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/phase/Failed.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/phase/Failed.java
@@ -33,8 +33,7 @@
      * @param data intentData
      */
     Failed(IntentData data) {
-        this.data = checkNotNull(data);
-        this.data.setState(FAILED);
+        this.data = IntentData.nextState(checkNotNull(data), FAILED);
     }
 
     @Override