Fix possible memory leak when dismissing a color picker