Fix Escape confirming Dialog.

When I introduced the trigger_close function, a small bug was introduced: pressing Escape confirmed the Dialog, instead of canceling.