db, simple_db: Fix a memory leak.

Close #1