Fix two pipe-initialization races that occur in replication.
Turns out there were two race conditions, either of which could lead to
a replication task hanging. In the first, the consumer thread could
potentially run before the pipe_shared structure was re-initialized in
the producer. In the second, the producer could post the first chunk
before the consumer initialized its pipe_private, so the sequence
numbers would be off. That's kind of ironic, since the sequence number
isn't strictly necessary and is only there to guard against a whole
different class of synchronization problems (for which purpose I think
it should remain). Here's a brief summary.
* replica.c: moved re-initialization of pipe_shared to be before thread
start (race #1)
* mpipe.c: changed initialization of pp->sequence in pipe_init_private
(race #2)
* iwh.h: added PID to DPRINTF to distinguish parent/child output
* backend.c: fixed bytes==0 behavior in fs_put_child (unrelated)
* rest.c: fixed pipe_prod_wait_init check in proxy_put_data (unrelated)