support for http(s) basic authentication

This is an adaptation of the original patch submitted in [1], without the
monkey-patching: a patch has been committed in dulwich [2] which allows clients
to supply a custom urllib2 "opener" for opening the url; here, we provide such
an opener, which provides authentication information obtained from the hg
config.

[1] https://groups.google.com/forum/#!topic/hg-git/9clPr1wdtiw
[2] https://bugs.launchpad.net/dulwich/+bug/909037
fallback to unauthenticated http(s) access when using older dulwich
hg2git: rename ctx to newctx in update_changeset

An upcoming patch will introduce a new field called _ctx. This helps prevent
confusion.
hg2git: store ctx instead of rev

Storing a ctx enables values like manifests to be cached on the context.
hg2git: call status on newctx, not newctx.rev()

There's no benefit to calling rev().