Improve signal handling
Currently, we set the signal handler in the
__init__ methods for the samplers, e.g., https://git.ligo.org/lscsoft/bilby/-/blob/master/bilby/core/sampler/dynesty.py#L176-178.
These typically lead to calling a checkpoint function which only really makes sense during sampling.
This leads to some weird behaviour if the signals come after the sampler finishes or before the setup is complete. I've noticed this when jobs are interrupted during parameter reconstruction.
I suggest that instead we should set up the handler immediately before launching the sampler and change them back after the sampling is done.
We may also want to look at having a specific handler for the parameter reconstruction in the GW case.