[MINOR] stats_dump_errors_to_buffer: use buffer_feed_chunk()

We can simplify the code in the stats functions using buffer_feed_chunk()
instead of buffer_write_chunk(). Let's start with this function. This
patch also fixed an issue where we could dump past the end of the capture
buffer if it is shorter than the captured request.
diff --git a/include/proto/dumpstats.h b/include/proto/dumpstats.h
index 7a92c98..4dd9e34 100644
--- a/include/proto/dumpstats.h
+++ b/include/proto/dumpstats.h
@@ -51,7 +51,7 @@
 int stats_dump_http(struct session *s, struct buffer *rep, struct uri_auth *uri);
 int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri);
 void stats_dump_sess_to_buffer(struct session *s, struct buffer *rep);
-void stats_dump_errors_to_buffer(struct session *s, struct buffer *rep);
+int stats_dump_errors_to_buffer(struct session *s, struct buffer *rep);
 
 
 #endif /* _PROTO_DUMPSTATS_H */