avoid looping on error

I saw some cases where we'd get stuck looping after hitting a broken
pipe.  If we detect an error, avoid triggering the speculative
read/write logic that was recently added for ssl enabled sockets