ITS#7943 reinit txn flags

When reusing the main write txn
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
 lmdb: clean testdb-dir while "make test".
 fix: reordering of instructions which update the txn in a meta-page.

 Without "volatile" or memory-barrier compiler may reorder instructions
 for update the "mm_txnid" field in meta-page in "writemap" mode.

 From the reader's point of view this cause a short
 time interval when the transaction is corrupted.
 writemap: lock meta-pages to avoid unexpected write,
           before the data pages would be synchronized.
 lmdb-backend: checkpoint-interval seconds instead of minutes.
 lmdb: implementation of "checkpoint kbytes",
       force flush when volume of the changes reached a configurable threshold.
 lmdb: more usefull info from mdb_stat tool;
 lmdb: properly sync meta-pages in mdb_sync_env(),

       check-and-retry if lead txn-id changed
       during flushing data in mdb_sync_env().
 lmdb-backend: support for "checkpoint kbytes" config-option.
 lmdb-backend: conditionally support config for 'lifo' and 'coalesce' envflags;
 ! conditionally enforce MDB_LIFORECLAIM & MDB_COALESCE (this MUST be remove from the release);
 ! test pattern hack (this crunch MUST be remove later);
 lmdb: MDB_LIFORECLAIM & MDB_COALESCE modes;
 lmdb-backend: just backtrace for SIGSEGV (draft);