largefiles: use common function to build content of .hg_archival.txt
This fixes the missing "changessincelatesttag" field introduced by
242d11819c6c.
archive: extract metadata() closure to module-level function
This function will be reused in largefiles.