Repository.xs: Added is_head_detached()

This allows use to see if a repository's head is detached, without looping over all branches and checking if one of them is.