Tweak prev commit again

Make sure errors are propagated from init_meta
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
ITS#7654 fix implicit declaration warnings
ITS#7654
ITS#7591 fix back-meta missing result msgs
ITS#7591
Clarify doc: mdb_copy, nested txns, mdb_drop().

mdb_copy: Does not copy lockfile. Can trigger file growth.
mdb_txn_begin(): Clarify usage restrictions.
mdb_drop(): State what to do rather than what will be done, since
closing the handle could otherwise be read as happening even at failure.
Tweak comments
Silence warnings
ITS#7645 more for TLSProtocolMin
Use proper printf format on Windows
Fix mdb_reader_pid().

Treat unexpected errors as "don't know".  Invert Pidcheck return
value, so nonzero including error codes = "the process may exist".

On Windows: Catch exited but still existing processes.  Handle
undefined PROCESS_QUERY_LIMITED_INFORMATION.
On Unix: don't trust F_GETLK error to leave the input alone,
the fcntl() doc seems unclear.
MDB_LOCK_VERSION -> MDB_LOCK_FORMAT.

Pid locking needs a different lockfile-version: MDB_env's with and
without pid locking must not coexist, they can sabotage each other.
Store MDB_LOCK_FORMAT = (version | "use locking" flag) instead.
Factor out MDB_env.
Set MDB_TXN_ERROR when inconsistent txn state
Fix page spilling when MDB_WRITEMAP.

mdb_page_spill(): Don't binary-search the unsorted dirty_list.
mdb_page_flush(): Don't overwrite unprocessed dirty_list items.
Fix mdb_ovpage_free() vs. spill.

Ensure me_pghead has room before removing from spill/dirty list.
Don't return pages to me_pghead in nested txns, use mt_free_pgs.
mdb_cursorpages_mark: Mark current txn and no more.

Ignore parent txn cursors since it is the current txn's dirty_list
which will be flushed. But check the current txn also when clearing,
since cursors can have pages which are dirty in a parent.

Check !mc_xcursor instead of !MDB_DUPSORT.  Equivalent for valid
data, but a bit safer if the sub-DB flags are corrupt.
Re-fix reader-pid code
Replace unpredictable EINVAL error returns.

Return EINVAL only for simple programmer errors.