Clear validation errors on window close, insert content back into the editor on window close