Only use the pipelining buffer when it is actually needed

Also refactor the transfer encoding so it is no longer nessesary
to setup the handler, as it is required for every http connection