fix issue with wrong base branch being chosen

The head_branch.py script should use the branch name from the 'base'
of the pull request (e.g. development), rather than the branch name
from the fork (e.g. fix-xxx) which will probably not exist on base.