Add chunked transfer support and retry after malformed responses

If a server downloads using chunked transfers there is no Content-Length
so manufacture one.

Some Fedora mirrors using nginx are returning bogus responses without
the proper response headers causes failures.  Ignore them and retry up
to five times.

Ignore body callbacks on HEAD requests, they are usually html formatted
error messages from broken nginx mirrors.

Fix version in User-Agent header.