Add helper function to test for end-to-end
Allocate I/O buffers in the target thread

Previously the I/O buffers were allocated in the worker threads. This
commit is a necessary first step for fixing end-to-end connections
with XNI.

Except that this commit breaks end-to-end transfers.