[dynamo] bugfix - make module setattr more restrictive (#107828)
A check got missed in https://github.com/pytorch/pytorch/pull/106092
Fixes https://github.com/pytorch/pytorch/issues/107721
Pull Request resolved: https://github.com/pytorch/pytorch/pull/107828
Approved by: https://github.com/eellison