Rearrange MDB dirty page code.

Split out mdb_dpage_free(), mdb_page_flush() and clean up.
Factor out MDB variables/expressions, cleanup.

mdb_page_malloc(): Take a txn arg instead of a cursor.
Tweak MIDLs, catch errors.

Grow midls earlier in order to catch errors earlier.  Use
mdb_midl_need() instead of mdb_midl_grow(), then mdb_midl_xappend()
needs no error checks. Factor out mdb_midl_append_range().
Catch more MDB errors. DPRINTF in mdb_env_reset0.
Fix Windows I/O.

Don't put a 64-bit filesize in a 32-bit int before shifting
down.  Always pass &sizehi to SetFilePointer->maxsize, so
sizelo not is treated a signed distance.  Hide unused vars
when _WIN32.  Reinitialize OVERLAPPED before reuse.
Improve MDB error handling, drop seek calls.

Catch I/O errors. Do nothing between OS call failure and ErrCode().
Do not use errno after non-OS-errors like write() >= 0, which could
give a failure return of success (errno 0) or some irrelevant error
code.  Drop seek calls, use pwrite/pread/Windows OVERLAPPED offset.
Tweak I/O, fix last commit.
Makefile/user-macro comments.
Factor out some vars, simplify.
Fix alloc/free issues.

Page leak, mdb_page_alloc(). On error, don't shorten me_pghead.
Memleak, mdb_ovpage_free(). Free page or keep it in dirty_list.
Bad MIDL, mdb_midl_need(). Fix midl[-1] (allocated size).
Fix uninit warnings, lseek usage
ITS#7635 fix read txn potential data race
ITS#7635 simplify 9474c1a0b62cad57b62855d09a201670385caa80
Tweaks for MDB_MULTIPLE

Terminate loop on intermediate failures, return count of written items,
document usage.
Silence uninit warning in prev commit
Silence more uninit warnings
Simplify MDB_cursor: Drop flags C_ALLOCD,C_SHADOW.
ITS#7515 Fix tracking of parent txn's cursors.

Restore mc_flags and xcursors, they were tracked but not merged.
Simplify: Track parent txn's original cursors after backing them
up, instead of tracking copies and merging them back at commit.
ITS#7515 Reject conflicting page versions.

If mdb_page_touch() sees a page in txn's dirty_list, that
is the page version txn's cursors should have.  Fail if
the user may be seeing and depending on another version.
Fixup other cursors after delete op