server connections work with exiting threads properly