erdtlsconnection: Only join the thread if it actually exists

We create the thread only when the connection is started and
the timeouts are added to the connection.
erdtlsenc: Don't close NULL connections in READY->NULL