Add handling of list write to remove mutation (#62904)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/62904
Test Plan: Imported from OSS
Reviewed By: SplitInfinity
Differential Revision: D30168493
Pulled By: eellison
fbshipit-source-id: 3b25982b235938cc7439dd3a5236dfce68254c05