[8.0] incorrect serialisation of log_handler to configuration file breaks log-handler

Saving `log_handler` to the config file is not currently special-cased, the value is thus dumped as the repr() of the list, but not deserialized with literal_eval. This means `-s` breaks `log_handler` and the configuration file example is incorrect (it looks like a list).

Repeated `-s` further break the `log_handler` by interpreting the original value as a string, putting it into a list, then reserialising that with repr(), injecting a bunch of escaping backslash. The config file is soon filled with backslashes and doubles in size with each new `-s`.

Furthermore for some reason the whole thing breaks `--log-handler` (and aliases) entirely, once the wrong `log_handler` has been saved none of them works anymore.

- [x] correctly serialise and deserialise `—log-handler` to and from the config file, as a comma-separated list of specs
- [x] don't overwrite config file loggers, config file and command-line should be additive
- [x] deduplicate loggers, if the same logger is used multiple times at the CLI or comes from both config file and CLI, the last CLI instance should be the only one remaining

Done. Also moved it with the other utility functions at the top of the file, and marked check_ssl as internal (it wasn't marked)