tracing/core: use appropriate waiting on trace_pipe