tracing: Only call pipe_close if pipe_close is defined