MEDIUM: buffers: implement b_adv() to advance a buffer's pointer

This is more convenient and efficient than buf->p = b_ptr(buf, n);
It simply advances the buffer's pointer by <n> and trasfers that
amount of bytes from <in> to <out>. The BF_OUT_EMPTY flag is updated
accordingly.

A few occurrences of such computations in buffers.c and stream_sock.c
were updated to use b_adv(), which resulted in a small code shrink.
diff --git a/include/proto/buffers.h b/include/proto/buffers.h
index 5caff85..f82e461 100644
--- a/include/proto/buffers.h
+++ b/include/proto/buffers.h
@@ -242,6 +242,19 @@
 	return right - left;
 }
 
+/* Advances the buffer by <adv> bytes, which means that the buffer
+ * pointer advances, and that as many bytes from in are transferred
+ * to out. The caller is responsible for ensuring that adv is always
+ * smaller than or equal to b->i. The BF_OUT_EMPTY flag is updated.
+ */
+static inline void b_adv(struct buffer *b, unsigned int adv)
+{
+	b->i -= adv;
+	b->o += adv;
+	if (b->o)
+		b->flags &= ~BF_OUT_EMPTY;
+	b->p = b_ptr(b, adv);
+}
 
 /* Return the amount of bytes that can be written into the buffer at once,
  * excluding the amount of reserved space passed in <res>, which is