Fix race between the pipe createn and CLOSE/EOF message

When the EOF or CLOSE message received earlier than the pipe created,
the pipe did not indicated the EOF or CLOSE event.