Fix issues when connecting to an untrusted relay server (#18140)
Summary of the issue:
1. When requesting for a relay server to generate a key, if the server's
certificate is not trusted, the process fails and the indeterminate
progress dialog stays open indefinitely.
2. When connecting to a server with an untrusted certificate, NVDA asks
the user if they want to disconnect before asking them whether to trust
the server's certificate. It also plays the disconnection sound.
Description of user facing changes
1. Requesting a key from a server with an untrusted certificate asks the
user if they want to continue.
2. Connecting to a server with an untrusted certificate no-longer asks
the user if they want to disconnect before asking them to confirm, and
no longer plays the disconnection sound.
Description of development approach
1. Fixed a typo where `IndeterminateProgressDialog.Done` was being
called instead of `IndeterminateProgressDialog.done`.
2. Refactored `RemoteClient.close`.
1. The business logic of disconnecting is still in
`RemoteClient.disconnect`.
2. The logic for asking the user to disconnect is in
`RemoteClient.doDisconnect`. This is similar to the pattern for
`doConnect`.
3. Fixed associated unit tests, by removing the unwrapping of
`RemoteClient.disconnect`, as `doDisconnect` is now wrapped in
`alwaysCallAfter`.
3. Added an internal-use keyword-only parameter, `_silent`, to
`RemoteClient.disconnect`, which defaults to `False`. If `True`, this
bypasses calling `cues.disconnected`.
Testing strategy:
Generated certificates using nvdaremote.com and a self-hosted relay
server with a self-signed certificate.
Connected to and disconnected from nvdaremote.com and the same
self-signed server.
Known issues with pull request:
None