cachedb_sql: fix pkg memory leak

When fetching a key, the db_res_t structure would not be properly freed.
(cherry picked from commit e5ccde131eb72debd9aa400ced2e1e31bd61612d)

Conflicts:

	modules/cachedb_sql/cachedb_sql.c
(cherry picked from commit f7d30b6e6ec8a6bea58bccc99b6b107a8dd0c340)