Bug 963042 - Added event listener for SwapDocShells to ensure we save state when swapping docShells r=ttaubert