Add means to respond to ScripterWindow close event from application

The test program exits the application in the close event handler.