Fixes touch frozen docs [ #2779 ]

When trying to touch a document that is frozen(delete , for instance), write_attribute cannot happen.