gtkui: Clean up used resources
gtkui: Fix bug where menu items sometimes disappear