fix test flakiness caused by sys.getrefcount(None) (#45876)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45876
sys.getrefcount() can be flaky before/after scope() call
Test Plan: buck test mode/opt-asan //caffe2/test:others -- 'test_none_names_refcount \(test_namedtensor\.TestNamedTensor\)' --run-disabled
Reviewed By: malfet
Differential Revision: D24123724
fbshipit-source-id: 4af0b150222cfb92dd0776a42fcab44d896a772a