#11149 Make sure hitting the close button does not trigger double prevent navigation warnings

See discussion in modxcms/revolution#11149