Retry returning AppId after reload triggered by cache miss

Change-Id: I5b5f872ccdd72ccbc8a09bd221821b24a841e04b
diff --git a/core/store/dist/src/main/java/org/onosproject/store/core/impl/DistributedApplicationIdStore.java b/core/store/dist/src/main/java/org/onosproject/store/core/impl/DistributedApplicationIdStore.java
index 186fb4e..e6917ec 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/core/impl/DistributedApplicationIdStore.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/core/impl/DistributedApplicationIdStore.java
@@ -99,6 +99,7 @@
         ApplicationId appId = appIds.get(id);
         if (appId == null) {
             primeAppIds();
+            return appIds.get(id);
         }
         return appId;
     }
@@ -110,7 +111,7 @@
 
     private void primeAppIds() {
         for (DefaultApplicationId appId : appIdsByName.values()) {
-            appIds.put(appId.id(), appId);
+            appIds.putIfAbsent(appId.id(), appId);
         }
     }