Fix CURSOR_LAST/CURSOR_PREV
MSVC doesn't define mode_t
Tweak mode_t def per Hallvard's suggestion
Fix MDB_DEBUG compile when no varargs macros.

Variables mdb_debug, mdb_debug_start were used undefined.
Silence signedness warning
Plug MDB memory leak of DB names.
ITS#7556 fix cursor_sibling for PREV
More fixes for MDB_LAST

Make sure C_INITIALIZED gets set on successful call
Fix rebalance when collapsing root page

When fixing other cursors, must also fix their depth.
Fix d3990eb2f8b2944782604a2ca7bd52e08c58fc3e

Append mode should *reject* keys that are too small.
Also allow APPENDDUP in mdb_put().
Fix 6beaad52129da5353fd40c0ec48e6a78c4f71a2e

In APPEND don't immediately reject matching key, since this
is valid for APPENDDUP.
ITS#7561 Fix mdb_drop bugs

Check for overflow pages, reset cursor position properly.
Fixes for dbi_open/close, ITS#7515
Revert "Fix 6beaad52129da5353fd40c0ec48e6a78c4f71a2e"

This reverts commit 8eef7a4275eda8f2fa2e0d1e67c1d5cbcd91607e.
Previous commit was correct, duplicate keys should not appear here.