WinTLS: Fix abrupt connection closing and closing in general.

Fixes GH-277