[shard] fix init_from_local_shards issue with deepcopy (#73400)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73400
fixes https://github.com/pytorch/pytorch/issues/73096
Sometimes when user using `init_from_local_shards` api, it might hit in-proper metadata issue mainly bc of we are not deep copying it (it happens with some multithreading tests), so added a deep copy there.
ghstack-source-id: 150351616
Test Plan: didn't add tests bc it only happens in multithreading env, which is not common.
Reviewed By: fduwjj, xush6528
Differential Revision: D34460242
fbshipit-source-id: aeb8f6d4032d20ab73c32f5f15d3407dc8b5c9ae
(cherry picked from commit 98a3ee2cfd46daf1e9ac8f18ad815d927caa47d2)