Fix GET_BOTH_RANGE

On near match, return the matched data.
Clean up mdb_copy.

Support MDB_NOSUBDIR. Catch more errors.  Write messages
to stderr, not stdout which the data too may be piped to.
Warning cleanup.

Drop unused computed/assigned values.
mdb_page_alloc(): Make "mop_len>0 implies mop!=NULL" provable.
Add EVEN(): Micro-optimize "up to multiple of 2".
put(MDB_MULTIPLE): Skip existing item cleanly.

Don't set dkey.mv_size if mdb won't clear it before next iteration.
ITS#7589 Fix delete(uneven-sized MDB_DUPFIXED data).

Do not give uneven sizes to the sub-page and the node it lives in.
ITS#7589 Fix me_nodemax and related node sizes.

Change me_nodemax to not count the mp_ptrs[] entry. That's mostly
how it was used. Compare node sizes ">" me_nodemax instead of ">=".
The ">=" was a workaround for confusing sizes with and without the
mp_ptrs[] entry, but broke for nodes with size (old me_nodemax-1).

Explicitly make me_nodemax even. An odd value could break the
comparisons. It was even anyway because MDB_MINKEYS == 2.
Relax MDB_MAXKEYSIZE for existing data.

Handle keys stored by a liblmdb with a bigger MDB_MAXKEYSIZE.
mdb_get/mdb_del(absent key bigger than our MDB_MAXKEYSIZE)
now return MDB_NOTFOUND instead of MDB_BAD_VALSIZE.
Raise safe max MDB_MAXKEYSIZE.

Use a sub-DB for DUPSORT item #1/#2 per key if needed: Not a sub-
page too big for a node, nor an overflow page (which not all DUPSORT
code checks for). Move "insert" code, to avoid non-loop goto upwards.

(This is the commit which needs the change to xdata.mv_size in
commit 9d6e4a916367e85ffdf37b1cb7b5cdb7ac0e15b5 "page sizes".)
Support dynamic max MDB keysize.
Fix mdb_reader_list() and its spec.

It and the MDB_msg_func can now return >= 0 for success.
Always return any MDB_msg_func() error result.
Comment MDB_node, mdb_page_unspill, mdb_update_key
Replace MDB_node.mn_offset[], to ease debugging.
Fix commit "Raise safe max MDB_MAXKEYSIZE."

I.e. d69d2ce2307e9d0e2167843935c386b05a869c31, it left out some changes.
Drop UNLOCK_MUTEX_R() on mdb_reader_pid() error
ITS#7515 has been fixed.
ITS#7665 Drop lmdb.h doc on non-overlapping flags.

It was inaccurate and misplaced. Verify it in mdb.c instead.
ITS#7772 Reduce spurious sub-page growth.

mdb_cursor_put(): Use free sub-page space added by a
previous put(existing DUPSORT item), if any.
Tweak NUMKEYS code to avoid a new signedness warning.
Add mdb_dbg_pgno(): (sub)pagenum for debug output.
sprintf format: pid_t need not be an int.