Implement the PIPE.wait function

This blocks on the EVENT (channel, or other source of events) until
n units of data are available for reading or writing.

Signed-off-by: David Scott <dave.scott@citrix.com>