Guard config copy for pickle errors (#161659)
Summary:
X-link: https://github.com/pytorch/pytorch/pull/161659
Approved by: https://github.com/zou3519
Reviewed By: atalman, zou3519
Differential Revision: D81168335
fbshipit-source-id: c23b8da33b7c48966f4aff4dfc8130f20398bc37