Add automatic shutdown for external scheduler
When using the external scheduler option, for example, to run Midas on an HPC, we rely on the HPC scheduler, in our case usually Slurm, to shut down the scheduler and worker processes. This works fine in some cases, but depending on the run script and the scheduling environment, the scheduler process may stay alive and keep the job running longer than necessary. It is also cleaner if the client shuts down the cluster when it is no longer needed. Since it is in principle also possible to share the cluster for different applications, we can implement this automatic shutdown as optional.