Split out mdb_midl_xmerge, add MDB_IDL_ALLOCLEN
Fix loose pages in mdb_freelist_save().

Leaving them in dirty_list caused breakage.  Instead merge them
into me_pghead at the end, when no more pages will be allocated.
Microoptimize loose pages
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_5
Partially revert ada26306992babeccad0c5443fbd76e28dd24cd6

Of course, MacOSX only has posix_memalign, and only in recent versions.
(Older versions could use valloc instead. That precludes ever changing
the LMDB pagesize to be different from the OS pagesize.) Not all that
crucial since it only affects mdb_env_copyfd1.
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_5
Fix typo
ITS#7922 delete dead code

Harmless, but stupid.
ITS#7904 more tweaks

Must save/restore mcd cursor if we're doing a scope-based search.
ITS#7906,#7923 Don't free configinfo in _db_close
More for MIPS

Move CACHEFLUSH, avoid unnecessary if()
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_5
Cleanup mdb_ad_get
ITS#7913 cleanup

we already checked for data == NULL, drop unnecessary if
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_5
Note 7926
ITS#7927 fix double-free of searchref
ITS#7702 fix results with aliases

Aliases pointing within the original search scope could cause
the same entry to be returned multiple times. Check for subtree
scope and duplicate scopes.
ITS#7904 init wwctx earlier
Revert "ITS#7702 fix results with aliases"

This reverts commit cac00c6a97bbbbcec75f2ebcffaae1dd1769a28e.