Fix a seg fault caused by the widget being deleted during glib signal handling.