Don't try to stop a task that isn't running.
Don't try to stop a task that isn't running.

Also add a number of assertions and improve logging a little.

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