Fixing closing overlays on ESC.

Every page of in the overlay registers its own cancelOverlay event
handler which allows them to return to other overlays when ESC
button is pressed rather that the default main page.

reviewer: @mvrable