Leveraging Travis' environment variables to find out whether we're testing the head.

Turned out that git would always be in detached head mode after
git checkout <hash>, which is what Travis does.