This tries to maximize the use of the visit status to determine the save code now
request's final status (succeeded or failed). When such data is not available, it's most
likely the task is not yet scheduled, scheduled or currently running. So, it then
fallbacks to try and use the scheduler task/task_run to deduce such non-final
status (e.g scheduled/running/not yet scheduled/...).
Related to T3378