cachedb_sql: fix pkg memory leak

When fetching a key, the db_res_t structure would not be properly freed.