ldbGenericReplace: correctly handle files with same version but different flags

This fixes syncthing bug #819.