fix multi thread bug: fully clone metadata
refactor Writer part
factor out writer d-gap to TermMetaData