Prevent new history entry when exiting window wrapper