MAJOR: channel: remove the BF_OUT_EMPTY flag

This flag was very problematic because it was composite in that both changes
to the pipe or to the buffer had to cause this flag to be updated, which is
not always simple (eg: there may not even be a channel attached to a buffer
at all).

There were not that many users of this flags, mostly setters. So the flag got
replaced with a macro which reports whether the channel is empty or not, by
checking both the pipe and the buffer.

One part of the change is sensible : the flag was also part of BF_MASK_STATIC,
which is used by process_session() to rescan all analysers in case the flag's
status changes. At first glance, none of the analysers seems to change its
mind base on this flag when it is subject to change, so it seems fine not to
add variation checks here. Otherwise it's possible that checking the buffer's
output size is more useful than checking the flag's replacement.
diff --git a/src/channel.c b/src/channel.c
index 2789e89..825ed7b 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -127,7 +127,7 @@
 	buf->buf.p = b_ptr(&buf->buf, len);
 	buf->total += len;
 
-	buf->flags &= ~(BF_OUT_EMPTY|BF_FULL);
+	buf->flags &= ~BF_FULL;
 	if (bi_full(buf))
 		buf->flags |= BF_FULL;
 
@@ -242,7 +242,7 @@
 	max = len;
 
 	/* closed or empty + imminent close = -1; empty = 0 */
-	if (unlikely(buf->flags & (BF_OUT_EMPTY|BF_SHUTW))) {
+	if (unlikely((buf->flags & BF_SHUTW) || channel_is_empty(buf))) {
 		if (buf->flags & (BF_SHUTW|BF_SHUTW_NOW))
 			ret = -1;
 		goto out;
@@ -314,11 +314,11 @@
  * buffer <b>, and moves <end> just after the end of <str>. <b>'s parameters
  * <l> and <r> are updated to be valid after the shift. The shift value
  * (positive or negative) is returned. If there's no space left, the move is
- * not done. The function does not adjust ->o nor BF_OUT_EMPTY because it
- * does not make sense to use it on data scheduled to be sent. For the same
- * reason, it does not make sense to call this function on unparsed data, so
- * <orig> is not updated. The string length is taken from parameter <len>. If
- * <len> is null, the <str> pointer is allowed to be null.
+ * not done. The function does not adjust ->o because it does not make sense to
+ * use it on data scheduled to be sent. For the same reason, it does not make
+ * sense to call this function on unparsed data, so <orig> is not updated. The
+ * string length is taken from parameter <len>. If <len> is null, the <str>
+ * pointer is allowed to be null.
  */
 int buffer_replace2(struct channel *b, char *pos, char *end, const char *str, int len)
 {