Dump logs when unloading plugins
When a plugin is about to be unloaded (because it is going to be replaced by a newer version, the whole daemon is shutting down, it disappeared from configuration), attempt to send the logs to the server before doing so.
We may need to define a new hook for that (and therefore possibly a new API version).
Do not try to dump the logs if it is being unloaded because of a crash (segfault or other) in that plugin.