[PyTorch] [Model Tracer] Use c10::Synchronized<T> for kernel dtype tracer (#73723)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73723
Currently, the kernel dtype tracer relies on the user to for advisory locking of the mutex when accessing shared data structures. This changes it to be mandatory locking using the `c10::Synchronized<T>` abstraction.
ghstack-source-id: 150407247
Test Plan:
Built model tracer successfully using:
```
buck build -c pt.disable_per_op_profiling=0 -c pt.enable_record_kernel_dtype=1 --show-output xplat/caffe2/fb/model_tracer:model_tracer
```
Reviewed By: JacobSzwejbka
Differential Revision: D34604068
fbshipit-source-id: 1ec50ada81126927da7c13e16b331fb43b00e53b
(cherry picked from commit 06c493c88e9af2845c364b5a3bff87f483f0fbfe)