upgrade: put exit statements in both conditional branches

This check was only occurring in one branch of the conditional.
As a result, if you ran `brew upgrade` with no args and there were no packages to upgrade,
the nonsensical message

"==> Upgrading 0 outdated package, with result:"

would be printed.

Closes #21316.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>