Fixed hanged threads on network shutdown