Polarssl can get a SIGPIPE when a connection is reset by the
peer. Deal with the sigpipe and the lost connection.