namedb: fixed leak, lmdb iteration

Conflicts:
	src/common/namedb/namedb_lmdb.c
	src/common/namedb/namedb_trie.c