[PyTorch] Use c10::Synchronized<T> in RWSafeLeftRightWrapper (#74061)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74061
As the title says - to prevent unintentional usage of the `data_` member without the lock held.
ghstack-source-id: 150555298
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: JacobSzwejbka
Differential Revision: D34645508
fbshipit-source-id: effa8064f92550cb4fdd078fd85887751d8f849d
(cherry picked from commit 377f85907c14c0f2f0bd19068ee23cf48df9e17b)