Do not set id of record if record is frozen

Noticed an issue when removing a record that has an attachment, that is, when this is triggered:
```ruby
after_destroy do
  send(attacher).delete!
end
```

In the `delete!` method, at the end, it sets the record's id to nil:
```ruby
self.id = nil
```

Setting the id to nil is needed by the remove_attachment feature, but if you remove the entire record, you get a frozen hash error, because you cannot modify the record when it's been marked for deletion. Not sure how to best solve this. One way is to check if the record is frozen, which I did here. Is there a better way?