Rework server protocol to be smarter and interoperate with cgit client.
This largely consists of correctly implementing multi-ack and
single-ack mode on the client side as well as stopping graph walking
when a sufficient set of common commits is found. Tests are included,
and the implementation has been lightly tested against the cgit
client. However, the dulwich server does not interoperate with the
dulwich client anymore; this will be fixed in a future change.
This change also preserves the GraphWalker interface so as not to
break hg-git or bzr-git.
Change-Id: Ia63e7fd0da9ff17c9f3f546149b474eb4f8bb466