fixed crash at exit if client thread could not shut down within 1 second