In order to avoid memory leaks, databases and
iterators should always be closed explicitly. Consider using
automate the closing/deallocation of these objects.
Please note: a database must not be closed while there are outstanding choices for some
lmdb_enumerate/3goal that refers to that database. Outstanding choices can be removed with a cut (