changed safeRecv to use poll() rather than recv()
change wait for poll to use safeRecv() rather than custom code
fixed iod to use the new process for messaging between threads