fix magit-get-next-branch, adding magit-rev-diff-count

This fixes #659.
Merge branch 'master' into next