patch 8.0.1286: occasional crash when using a channel

Problem:    Occasional crash when using a channel. (Marek)
Solution:   Decrement reference count later. (closes #2315)
diff --git a/src/channel.c b/src/channel.c
index 606c66a..8fc7050 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2898,8 +2898,6 @@
 	      channel->ch_close_cb = NULL;
 	      channel->ch_close_partial = NULL;
 
-	      --channel->ch_refcount;
-
 	      if (channel_need_redraw)
 	      {
 		  channel_need_redraw = FALSE;
@@ -2910,6 +2908,8 @@
 		  /* any remaining messages are useless now */
 		  for (part = PART_SOCK; part < PART_IN; ++part)
 		      drop_messages(channel, part);
+
+	      --channel->ch_refcount;
 	}
     }