Decouple shutdown code from Engine

* shutdown code is moved from Engine to AbstractWindow
* add input handler logic from the escape key, to shutdown the game