improved ssl write error handling...this hopefully fixes occasionally crashes when using ssl
and do the same when read
fix the fix...with the last change taskrambler closes connections unexpectedly. Hopefully this fixes ssl handling.