tool_operate: Move the trace and error file closure to tool_cfgable