Fix the de-init order of devices and analyzers (avoids random segfaults on exit).