add the same protection to context_free as for context_realloc, to guard against corruption when alloca is in use