Ensure static initialization is atomic (found by findbugs)

Review at http://gwt-code-reviews.appspot.com/341802

Review by: kprobst@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7951 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/Cookies.java b/user/src/com/google/gwt/user/client/Cookies.java
index f564b26..c30d50b 100644
--- a/user/src/com/google/gwt/user/client/Cookies.java
+++ b/user/src/com/google/gwt/user/client/Cookies.java
@@ -228,8 +228,9 @@
 
   private static HashMap<String, String> ensureCookies() {
     if (cachedCookies == null || needsRefresh()) {
-      cachedCookies = new HashMap<String, String>();
-      loadCookies(cachedCookies);
+      HashMap<String, String> newCachedCookies = new HashMap<String, String>();
+      loadCookies(newCachedCookies);
+      cachedCookies = newCachedCookies;
     }
     return cachedCookies;
   }