Stopped the page from refreshing on beforeunload

Just before the page unloads it triggers a final sync.  This commit
stops the sync from causing the page to be re-rendered.