Avoid potential segmentation fault in docker client.

Before i filled libcurl's headers list as follows: append each header to vector and add pointer to content of the header in the vector to headers list.
But vector may reallocate memory when new items are added, that may invalidate some pointers in headers list.