Fix a crash issue if there is not master branch.

Repo step:
1. Create a project.
2. git push http://xxxxx.git  master:test
3. Browse files from web.
4. Crash.

Root cause:
If the branch is not master, in RepositoryBrowser::TryGetBrunch(),
_repository.Head.Target will be null. _repository.Head.Target.Hash
will throw a null reference exception.

Fix:
if _repository.Head.Target is null, use the first branch as the default
branch.