common: Fix crash in channel flush_buffer()
common: Fix crash in channel flush_buffer()

If a text channel sends some invalid UTF-8 (such as reading utmp before
commit 05ce4d2aeb), cockpit_channel_send() queues (with a timer) a flush_buffer(),
so that the next received block can finish the incomplete glyph. But if
the channel got closed in the meantime, that ran into an already freed
`self`, and trying to access its properties crashed.

Fix that by stopping the timer in flush_buffer() if it is active --
closing the channel flushes the buffer in cockpit_channel_real_close()
anyway, so there is no point trying to write anything else afterwards.

https://bugzilla.redhat.com/show_bug.cgi?id=1943169

mvollmer/cockpit,cockpit-project/cockpit,martinpitt/cockpit,martinpitt/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,martinpitt/cockpit,mvollmer/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,mvollmer/cockpit,garrett/cockpit,mvollmer/cockpit,martinpitt/cockpit,garrett/cockpit,garrett/cockpit,mvollmer/cockpit,martinpitt/cockpit,garrett/cockpit,garrett/cockpit