RFC: support pipe reads based on a condition.

This is a proposal for pipe reading conditioned on a function. It is often
necessary to read lock a pipe and read data from it until some condition is met.
It is essential that we keep the lock for our own uses until we are done, to ensure
integral copyout of possibly fragmented RPC and other requests. Note this
was not an issue with the Plan 9 'il' protocol, became an issue with IP V4,
and will not be an issue with IP V6. But we have to support v4, even though
we're supposed to be beyond all that now. Legacy sucks.

The apipe_read_cond is called with a function, f, and an arg. Each time the
pipe is non-empty, f is called with the pipe and arg as parameters. F returns
0 until some condition is met, in which case it returns > 0, or until failure,
in which case it returns < 0. f may read data from the pipe by calling
apipe_read_locked.

If this design meets with approval (ha!) then I can create a qio function that
uses these semantics. But, I expect the Akaros guys will do something
better :-)

Included are the changes to 2 qio functions to show the usage. The
functions collapse to almost nothing since we are using apipes
and the locks go away too.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>