26566 maximize attachment sharing between revisions of a document

This fixes a problem when multiple copies of the same attachment get created in case of two documents having the same attachment content. 
This calculation has to change now that you're de-duplicating attachments. You'll have to surface the actual bytes written in copy_doc_attachments into sizes accumulator so that you're only counting bytes that were actually written. Otherwise with heavily duplicated attachments we'll end up skewing the size calculations leaving us with the possibility of having an active size greather than file size which is obviously impossible.