Import MDB cb1cc6483136b1404de29731279f81878fdf1199

Fixes MDB_LAST on exhausted MDB_FIRST->MDB_NEXT cursor.