Deletes a semaphore in destroy that was created in init to avoid leaking memory and resources.
Detaching threads when they are killed or exit so that their system resources will be freed (Posix threads).
Makes the new single-port listening code robust to getting an empty host name (it does not crash now, just goes back to listening on all ports).