Fix nits in the signal handling / termination logic.
Fix nits in the signal handling / termination logic.

petterreinholdtsen/tsdfx,petterreinholdtsen/tsdfx,dag-erling/tsdfx,dag-erling/tsdfx,petterreinholdtsen/tsdfx,dag-erling/tsdfx