Fixes bug where you could end up in a CPU spin when the SSL session closed.