Improve workaround for nsISessionStore.getClosedTabCount() failure on startup
Move ensureSessionsInitialized() to more corresponding place