Don't accept the alert when we're trying to dismiss it

If cancelButton().isNil() that doesn't mean there isn't a cancel button.
The cancel button is always button[0]. Press the dismiss button when requested
instead of calling acceptAlert().

Fix #1253