ITS#7943 reinit txn flags

When reusing the main write txn
ITS#7971 LMDB: clarification in mdb_txn_renew0().
ITS#7970 LMDB: Critical Heisenbug

Inconsistent reading & SIGSEGV due to the race condition.
ITS#7969 LMDB: volatile & __synchronize().

Globally shared fields of meta-data are not 'volatile'.
 TRIVIA - lmdb: clean testdb-dir while "make test".
 EXTENSION - lmdb: more usefull info from mdb_stat tool.
 CHANGE - lmdb-backend: checkpoint-interval in seconds instead of minutes.
 FEATURE - lmdb: implementation of "checkpoint kbytes".

 Force flush when volume of the changes reached a configurable threshold.
 FEATURE - lmdb-backend: support for "checkpoint kbytes" config-option.
 BUGFIX - 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().
 FEATURE - lmdb: MDB_LIFORECLAIM & MDB_COALESCE modes.

 Reclaim FreeDB in LIFO order - this is a main feature.
 Also aim to coalesce small FreeDFB records.
 FEATURE - lmdb-backend: support config for 'lifo' and 'coalesce' envflags.
 BUGFIX - lmdb: lock meta-pages in writemap-mode to avoid unexpected write,
           before the data pages would be synchronized.

 Without locking the meta-pages may be writen by OS before other data,
 in this case database would be inconsistent.
 ITS#7965 mdb_dn2id: heap corruption due to returning a reference to the local variable.
 EXTENSION - lmdb-backend: stack backtrace on SIGSEGV and friends (optional).
Silence compiler warning by adding explicit return 0 to ppolicy_db_destroy
Fix pointer incompatibility issue on some platforms

Don't assume tv_sec is a time_t.
closedir() replacement function should return a result

return success, ignoring result of FindClose
ITS#7967 fix abandon regression

From ITS#7712, avoid double-free of request
Fix a1e3b1cf3c5991ef550f608ee816e9274e547dda

copy/paste error