Add on_request_close event to window to check before the window is closed.
Merge pull request #2130 from matham/window-close

Add on_request_close event to window to check before the window is closed