Failure to detect closed connections when using Poll
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=1203
Reported by David Hedbor, Idonex / Real Networks david@hedbor.org
This is a problem in all Pike versions most likely. When using poll() in non-blocking mode w/o a read_callback, you won't know if the remote end closed down. When you use select, you get a write callback in which the write results in -1 (i.e error). With poll you don't get this last write callback. A fix is attached. It simply calls the write_callback in case of POLLERR or POLLHUP when there is no read_callback available.