[BE] Add regression test for aten shared build (#96697)
To expose errors similar to https://github.com/pytorch/pytorch/pull/94401#issuecomment-1466654593 in OSS CI
Building `aten_cpu` as a shared library with `-Wl,--no-undefined` simulates behavior of Android NDK toolchain.
Test plan: It should fail, see https://github.com/pytorch/pytorch/actions/runs/4410571970/jobs/7728232916#step:14:1386
Pull Request resolved: https://github.com/pytorch/pytorch/pull/96697
Approved by: https://github.com/kit1980