https://bugs.openldap.org/show_bug.cgi?id=10157
--- Comment #2 from Howard Chu hyc@openldap.org --- (In reply to Howard Chu from comment #1)
The code in your patch is not present in any recent release of LMDB. Since you didn't specify a version, we have no idea how far out of date you are, but regardless, that patch doesn't apply to anything current.
Correction - the code is not present in mdb.master. It seems we have an unreleased fix for this already in the tree.