Filter out detached entities for DumpTrackedEntities