Switch cuda 12.1 docker images to gcc9 (#102380)
Update CUDA-12.1 CI docker images to gcc-9, that should tentatively fix for internal compiler error in [libtorch-linux-bionic-cuda12.1-py3.7-gcc7 / build](https://github.com/pytorch/pytorch/actions/runs/5071681366/jobs/9135310361)
Co-authored by: Nikita Shulga <nshulga@meta.com>
Fixes: https://github.com/pytorch/pytorch/issues/102372
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102380
Approved by: https://github.com/malfet, https://github.com/huydhn