[FSDP] Fix local_state_dict and state_dict_type bugs
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77101
1. state_dict_type does not correctly clean up self._state_dict.type.
2. local_state_dict has wrong assumptions that self.module.flat_param must present.
Differential Revision: [D36260234](https://our.internmc.facebook.com/intern/diff/D36260234/)
Approved by: https://github.com/rohan-varma, https://github.com/zhaojuanmao