http: use urllib's cookie handler
Split the logic for loading the cookies based on the configuration in a
helper function and otherwise use the library implementation directly.
http: reuse Python's implementation of read/readline/readinto
Since Python 3 already provides a working implementation of readline,
there is no need for our own buffering implementation. Reduce the
code to transfer accounting only.