Initial stab at serializing stdout/stderr on P::A

I'm still not sure whether I covered the case that data may come in *after*
the pipe has been closed.  Probably not.  But at least this is an initial
stab at it.  FWIW, the associated test file fails about 1 in 5 times still
with segfaults and all sorts of other strange messages.  So there's still
work to be done!