ldbGenericReplace: correctly handle files with same version but different flags.

This fixes syncthing bug #819.
Merge pull request #820 from seehuhn/fixes

ldbGenericReplace: correctly handle files with same version but different flags