task array limit refactoring

Refactor the logic which checks a job array task limit and clears
the begin time at the same time as setting the wait reason to
WAIT_ARRAY_TASK_LIMIT