[inductor] Fix finalization issues when using multiprocessing
If python was launched with 'spawn' it will not use the standard
shutdown methods that concurrent.futures requires. So we register a
shutdown with the method it does uses. Without this, shutdown hangs
since the workers will not exit.
ghstack-source-id: 11f469f8960407f714188646676ccc709deddcbc
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87725