o Close connection with server after syncing to avoid client hanging on exit
    (#5507).