Reduce the chance of segfaulting

Change-Id: I8188b3be4f0fec756b5ab0f20122632a29a676ce
HTTP header fields are case insensitive

Change-Id: I9538983c3039f710f838329f5a0f6d0fd6597da7
Make header_value() more robust

Change-Id: Id52847dac96a47fd636c74bb8d659c8d295bced2
Make chunked-encoding decoding more robust

Change-Id: I17bff5ccfdeb92cb1a0253119e1c3b36023d8d6e