core: added defrag_generation counter that is increased each time when blobs are defraged. It is used by code that could have TOC vs TOU race between cache lookup and changing of record.