Fix debug assertion in TaskMutex when used outside of a task.