SSL.Connection: Fixed race condition with alert callbacks.
to_write() could get called with the pending alert before
the alert callback had determined what to do about the alert.
This caused the http to https redirect fallback in Roxen to fail,
due to to_write() having closed the stream before the callback
could steal it.