Expose setNumThreads to android api (#31205)
Summary:
PR https://github.com/pytorch/pytorch/pull/31033 was unlanded due to macos build failure:
https://app.circleci.com/jobs/github/pytorch/pytorch/3916388
This PR has changes that `setNumThreads` is only for android and moved to separate class `org.pytorch.PytorchAndroid` as a static function which is better as it has global effect
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31205
Reviewed By: dreiss
Differential Revision: D18977250
Pulled By: IvanKobzarev
fbshipit-source-id: 4995859808af498c82933c4db52bd7c7dfae90e5