generate-git-snapshot: support $SKIP_BRANCH_AND_TAG_HANDLING and detect Gerrit pushes

If the GERRIT_REFSPEC variable is set then our job was triggered
via Gerrit Code Review [http://gerrit.googlecode.com/]. If that's
the case we don't want to modify the Git repository checkout by
branch or tag because we already have what we need inside
$GIT_COMMIT. Instead let's create the temporary branch based
on $GIT_COMMIT, otherwise (if we don't create a branch on our own)
we're lacking a branch and git-dch fails with:

| + git-dch --auto -S --multimaint-merge --ignore-branch --new-version=[...]
| fatal: ref HEAD is not a symbolic ref
| gbp:error: Currently not on a branch

Using a branch like [origin/]refs/changes/$ID/$ID/$PATCHSET when triggering
the *-source job using $branch setting from Gerrit fails, because
the ref isn't directly available for checkout as branch, but
Jenkins does the job for us so we can rely on $GIT_COMMIT.