cachedb core: properly free raw query results

	* freeing more than 1 result leaked pkg mem

Fixes #226
(cherry picked from commit 0338917a979a3280273145b2b3a73400bc90a476)