Temporal Workflow/Activity cancellation non determinism

We were unable to replicate any detached cancellation issues. We noticed there wasn’t a clear test here so we opened a PR to add one.

This is a different error/situation. This is caused because something called inside the workflow is leaving the workflow task scheduler. In this case it looks like the logger implementation starts a thread which our non-determinism event listener catches as non-deterministic.

We do not current have a way to disable these safe-threading checks for specific parts. To workaround currently, you can either set TemporalWorkerOptions.DisableWorkflowTracingEventListener to true or you can see if NLog can eagerly start that thread instead of lazily. We may be able to add an enhancement request to disable the safe-threading check for certain portions of code such as loggers.