Precise alerts

Rework the record layer not to bail out completely upon encountering a TLS alert; instead cleanly distinguish between local and remote failure.

We can now talk to endpoints that send `CLOSE_NOTIFY` with the last data fragment in a single write.