Consider TRAVIS_BRANCH env variable when determining branch

The previous approach does not work with detached HEADs.
Merge pull request #43 from lgierth/branch-detection2

Consider TRAVIS_BRANCH env variable when determining branch