[AS7-6913] call closeAttachments after the operation completes

https://issues.jboss.org/browse/AS7-6913