Fix Esc key handling for button-less dialogs