[MEDIUM] make it possible to change the buffer size in the configuration

The new tune.bufsize and tune.maxrewrite global directives allow one to
change the buffer size and the maxrewrite size. Right now, setting bufsize
too low will block stats sockets which will not be able to write at all.
An error checking must be added to buffer_write_chunk() so that if it
cannot write its message to an empty buffer, it causes the caller to abort.
diff --git a/src/session.c b/src/session.c
index 23c4409..f0c2d86 100644
--- a/src/session.c
+++ b/src/session.c
@@ -330,7 +330,7 @@
 		}
 	}
 	else {
-		buffer_set_rlim(rep, req->size - MAXREWRITE); /* rewrite needed */
+		buffer_set_rlim(rep, req->size - global.tune.maxrewrite); /* rewrite needed */
 		s->txn.rsp.msg_state = HTTP_MSG_RPBEFORE;
 		/* reset hdr_idx which was already initialized by the request.
 		 * right now, the http parser does it.