[liblmdb] backport fix from mdb.master