Remove race condition in localforage init