lmdb: properly sync meta-pages in mdb_sync_env().
lmdb: properly sync meta-pages in mdb_sync_env().

Meta-pages may be updated during data-syncing in mdb_sync_env(),
in this case database would be inconsistent.

Check-and-retry if lead txn-id changed during flushing data in mdb_sync_env().

Change-Id: I806e6d3766d028dcd4e6b0591aabc718107056fb

leo-yuriev/libfpta,leo-yuriev/libfpta