Fix handling of branches with @ character

Fixes https://github.com/rowanj/gitx/issues/233.
Fix detached HEAD not showing in tree

Fixes: https://github.com/rowanj/gitx/issues/189