Fix string refcounting in context.c

adds missing fixes in context.c
But not entirely. We should ask @neithernut .