Fix incorrect precedence within git_repository_is_empty()

Reverts part of 9146f1e57ec4f2b6fa293c78d54f1383464ff5be.
repository: Make the is_empty check more explicit
Treat detached HEAD as non-empty repo

This simplifies the git_repository_is_empty a bit so that a
detached HEAD is just taken to mean the repo is not empty, since
a newly initialized repo will not have a detached HEAD.
Merge pull request #1814 from libgit2/is-empty-fix

Fix incorrect precedence within git_repository_is_empty()