ci/common: use gitlab CI target branch in get_upstream_branch
This prefers gitlab CI's target branch from the env, and falls back to the old target branch detection mechanism (using pmaports.cfg, etc) if it's not set. This fixes CI in gitlab where the target branch is something different than expected, e.g. if using stacked branches.