Fix EVT_CLOSE on application exit