test-ui: Fix crasher on exit

The test UI was crashing because we left closing through the
"Close" button destroy the window, which left all the pointers
dangling.

https://bugzilla.gnome.org/show_bug.cgi?id=724658