Fix incorrect precedence within git_repository_is_empty()

The correct logic checks whether HEAD is symbolic, assigns the result of that check to `error`, then fails if it's zero (i.e., HEAD is not symbolic).

#1728 introduced a subtle change to the precedence, causing it to assign the result of `git_reference_type()` to `error`. Since all of the `git_ref_t` values are non-negative, `git_repository_is_empty()` could bail out with an erroneously positive value.

This was caught (unintentionally) by surprising unit test failures in libgit2/objective-git#238.

@ivoire @vmg