[FSDP] Separate shared code into hooks
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75424
All load_state_dict implementations call synchronize(), so put this into hook for preparation of doing all FSDP-specific state_dict loading logic in pre/post hooks.
Differential Revision: [D35439351](https://our.internmc.facebook.com/intern/diff/D35439351/)
Approved by: https://github.com/awgu, https://github.com/zhaojuanmao, https://github.com/malfet