add support for chunked encoding

when using the jersey objectmapper support, we don't have the content length available can cannot figure it out beforehand
since we do not want to serialize the body twice and also don't want to force closing the connection for every request, we have to do chunked transfer encoding, which is fine for HTTP 1.1
For 1.0 connections we close the connection forcibly.