[lint] fixes to mypy linter
I thought I landed this already, but:
- Don't run one mypy instance per file, run one per config
- Do the same for flake8
- Properly handle stub files
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68479
Approved by: https://github.com/janeyx99