[GHF] Make `-g` wait for all (#79196)
Introduce `pr_has_pending_checks` and `get_pending_checks` functions,
increase wait time between checks to 5 min to reduce GH token
utilization
TODO: Need to propagate "on-mandatory" via bot, but IMO it's low priority
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79196
Approved by: https://github.com/janeyx99