BUG/MEDIUM: http: remove content-length form responses with bad transfer-encoding

The spec mandates that content-length must be removed from messages if
Transfer-Encoding is present, not just for valid ones.

This must be backported to 1.5 and 1.4.
(cherry picked from commit b4d0c03aee283e286880f93c4a8c053772a430c8)
diff --git a/src/proto_http.c b/src/proto_http.c
index 0afecd6..d6e37ed 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -6044,12 +6044,11 @@
 
 	/* Chunked responses must have their content-length removed */
 	ctx.idx = 0;
-	if (msg->flags & HTTP_MSGF_TE_CHNK) {
+	if (use_close_only || (msg->flags & HTTP_MSGF_TE_CHNK)) {
 		while (http_find_header2("Content-Length", 14, rep->buf->p, &txn->hdr_idx, &ctx))
 			http_remove_header2(msg, &txn->hdr_idx, &ctx);
 	}
-	else while (!use_close_only &&
-	       http_find_header2("Content-Length", 14, rep->buf->p, &txn->hdr_idx, &ctx)) {
+	else while (http_find_header2("Content-Length", 14, rep->buf->p, &txn->hdr_idx, &ctx)) {
 		signed long long cl;
 
 		if (!ctx.vlen) {