Added support for closing modal dialogs with escape key