Create function for custom header processing

Also improve comments and check return value for curl_slist_append()
calls.
Implement hdrv_append() function

Implement hdrv_append() which is a general function for appending to a
char* array. It is tailored for use with the req_t datatype in that it
is designed to be called like this:

hdrv_append(&(req->req_hdrv), &req->req_hdrc, somechar);

so that the *hdrc variable is also updated.

Also use it to add the "Content-Length: 0" header which was not included
previously.