upgrade: extract code in its own module
Given about 2/3 or 'mercurial.repair' is now about repository upgrade, I think
it is fair to move it into its own module.
An expected benefit is the ability to drop the 'upgrade' prefix of many
functions. This will be done in coming changesets.
bundle2: move the 'close' method off the unpackermixin
This method is unrelated to unpacking and only used by the unbundle20 class.
We move it there for clarity.