testbench: ipc: fix timing-related instability

Serial I/O is rather slow, and should not be used on the side that needs to
race a timeout into that IPC handshake.

Also, made fork_tid() somewhat more robust.