Now running Close() if necessary on a window being destroyed.
Fixing main loop of test code to keep running while at least one window is
open.