fix spinning indefinitely on partial TLS record (issue #1280)