Fix: crmd: don't segfault on shutdown when using heartbeat
The interface to use G_main_add_ll_cluster() was broken (incomplete)
since it was introduced.
->delete() does cleanup and free most of it, but it does not
actually remove and destroy the corresponding GSource, so the next
prepare/check iteratioin would find a corrupt (because partially
freed) GSource, and segfault.
So better use ->delete only after g_main_loop_quit().
Apparently one was supposed to store the GSource as returned by
G_main_add_ll_cluster(), and g_source_destroy() that "by hand".
But no-one ever did this, not even in the old hb code when this was
introduced.
Note that fsa_cluster_conn was set as an "alias" to cluster->hb_conn
in do_ha_control() right after crm_cluster_connect(), and only
happens to still point at that object, because do_ha_control() does
not reset it to NULL after crm_cluster_disconnect() above does
reset cluster->hb_conn to NULL.
Not sure if that's something to cleanup, too.
I'll try to fix this up in heartbeat proper, so ->delete
will actually remove, and destroy, and unref, and free this thing.
Doing so after g_main_loop_quit() is valid with both old,
and eventually fixed heartbeat.
If we introduce the "by hand" destroy/remove/unref,
this may break again (double free...) once heartbeat is fixed :-(