Move variables in check_job_status to prevent undeclared error

refs #13917