XWIKI-8681: XWikiAttachmentContent on-disk file cache leak open file descriptors

    - fix file descriptor left opened after duplicating an attachment content
    - avoid creating useless files and file descriptors for still empty attachment content
    - ensure attachment content properly set their FileSize into their parent records (not just when duplicated)

(cherry-picked from e8299e12af101d82696bb5e44b27d021fba20553)