Fix handling of HTTP/S keep-alives (RIPD-556)

Need this to be closely examined
Without knowing the low-level details sufficiently, a spurious wake-up to make us think we should write something would have a content length of 0, and then assert. poll() and friends send spurious events that something has data ready to be read, and that a socket is ready to be written, from time to time.