fix sqlite3 memory leak, implement export netdb option