refactor PipeWriter to generic uv_stream_t