Handle output of `git branch` with git v1.8+

In a detached state, `git branch` output has changed:

With git 1.8.3.1 

```
* (detached from 9aca70b)
  master
```

With git 1.7.9.5:

```
* (no branch)
  master
```

travis-ci.org build environments are installed git packages from https://launchpad.net/~pdoes/+archive/ppa. The last VM update upgraded git version, hence these recent build errors.