moving connections shutdown to separate thread instead of GUI thread