Fixes issue #549 (OpenSSL sockets spin indefinitely on timeout in handshake)

This pull request fixes Issue #549 (OpenSSL sockets spin indefinitely on timeout in handshake)

The only place that uses the return value of flushData can go into an infinite loop, and does so in production.

Just swapping the return values from flushData fixes the problem, and doesn't have any knock on effects we can find.