[tool] More main-branch detection improvement (#7067)

Follow-up to https://github.com/flutter/plugins/pull/7038 to try to make
it work on LUCI. Looking at the checkout steps of a LUCI run, it looks
like we do a full `fetch` of `origin`, but likely only have a `master`
branch locally. Rather than rely on a specific local branch name
existing, this allows for checking `origin` (and just in case, since
it's another common remote name, `upstream`).

Hopefully fixes https://github.com/flutter/flutter/issues/119330
3 files changed
tree: 79e7a939e7b07b988617c15f7794a62b7f659a84
  1. script/