Cleaned up Http chunked transfer encoding

This simplifies the handling for HTTP's chunked transfer encoding and also
fixes a unsigned/signed comparison warning.