Bug 239455 - Write updated popstate in tempfile first, then move over. r=irving, a=RyanVM