utils.git_info(): handle case of no remote tracking branch

If the local branch is not tracking a remote branch, the symbolic reference
'@{upstream}' is not resolvable. In that case, we can fall back to looking for
a common ancestor of the local branch and the remote.

If that fails, allow the error to propagate. Since this is presumably meant as
a security measure, we should not fall back to the local HEAD.

Change-Id: Ic85e5384d54ddfcb484940a145ea402fcd6b77e0