Add support for closing the window with window chrome or escape key.