[PyTorch] [Model Tracer] Use c10::Synchronized<T> for build features tracer (#73725)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73725
Currently, the build features 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: 150407248
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: D34604066
fbshipit-source-id: 29c5c23264f7bd7e13d0fb9dbc218af5663d06e9
(cherry picked from commit d0436d2817e5e36989070239c97b1ba2bc2ec7a2)