The code generation previously assumed a reference could not alter the value in a way the destructor would notice. This is an incorrect assumption for `&mut`, and is also incorrect for an `&` pointer to a non-`Freeze` type. Closes #7972