lib: Add a "mem_ctx" arg to gencache_get (unused so far)