construct version number from branch name better

The get-version-from-git script makes a debian version number from
information it gets from git.  Part of this is replacing any characters
that are invalid in version numbers with the character "-", but due to a
bug it used to just replace the *first* invalid character.  This commit
fixes it to replace *all* invalid characters.