Added valgrind detection (and fallback to poll instead of epoll) to RelayWriter