[PyTorch] Use c10::Synchronized<T> in RWSafeLeftRightWrapper (#74109)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74109
As the title says - to prevent unintentional usage of the `data_` member without the lock held.
ghstack-source-id: 151471742
Test Plan:
Build 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: D34822913
fbshipit-source-id: 956fbe78956cf556fd6c8481b910acf557fbe608
(cherry picked from commit 9e4e3115f8e92bc4834179902d7ca79b3f97d985)