Improved connection close sync.