Proper handling of interrupted threads in daemon_connection