[CORD-1113] Fix race condition problem of DistributedRouteStore

Race condition happened if one node add event listener after other nodes
send event.

The local route table might not be initialized correctly

Change-Id: Id6ff1344897e36d7d48ccf36b1b0b843ea2e9d09
diff --git a/incubator/store/src/main/java/org/onosproject/incubator/store/routing/impl/DistributedRouteStore.java b/incubator/store/src/main/java/org/onosproject/incubator/store/routing/impl/DistributedRouteStore.java
index 3263ae6..703b165 100644
--- a/incubator/store/src/main/java/org/onosproject/incubator/store/routing/impl/DistributedRouteStore.java
+++ b/incubator/store/src/main/java/org/onosproject/incubator/store/routing/impl/DistributedRouteStore.java
@@ -88,14 +88,14 @@
                 .build()
                 .asDistributedSet();
 
-        masterRouteTable.forEach(this::createRouteTable);
-
         masterRouteTable.addListener(masterRouteTableListener);
 
         // Add default tables (add is idempotent)
         masterRouteTable.add(IPV4);
         masterRouteTable.add(IPV6);
 
+        masterRouteTable.forEach(this::createRouteTable);
+
         log.info("Started");
     }