[PyTorch] [Model Tracer] Use c10::Synchronized<T> for build features tracer (#74107)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74107
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: 151471748
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: malfet
Differential Revision: D34822914
fbshipit-source-id: c704826b3f56f38538009b1e91e3454a0cec4754
(cherry picked from commit cce5caeac59e1996e96592eb7aa863a99e356f79)