githook: Query the branch name rather than assuming 'master'.

Uses technique from Gitster's blog:

http://git-blame.blogspot.com/2013/06/checking-current-branch-programatically.html

Thanks Junio for the tip!