Fix git-p4 rebase to detect the correct upstream branch instead of unconditionally