Correctly check return value of SSL_write.