checkheads: extract bookmark computation from the branch loop
No branch specific data are used in the computation of the bookmarked heads. We
can only compute it once.
checkheads: simplify the structure build by preprocessing
All useful data are now gathered in a single dictionnary.
`branchmapsummary` is renamed to `headssummary` and its return value
is greatly simplified.
_updatebranchcache: prevent deleting dict key during iteration
We use dict.keys() to fetch all keys before starting to delete some. Otherwise
python complains that the dictionnary is altered during iteration.