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

This fixes #659.