Close all connections after syncing (#5518).