glui: Fix potential memory leak