class-group: Properly weak_unref window
Reported from https://discourse.gnome.org/t/python3-wnck-throw-segmentation-fault/19943 (Note that I don't normally use this library, I just debugged it.)
A weak_ref is added in _wnck_class_group_add_window
but it isn't
weak_unref in _wnck_class_group_remove_window
. This means that when
the class group is destroyed, and then the window is destroyed (such as
the user code holding a strong reference to that window), the handler
would operate on an already-destroyed class group.
Also do this weak_unref dance while finalization. This doesn't seem to normally happen (the windows are likely already removed), but just in case.