Refactor step complete logic

Remove some duplicate code. No change in functionality.
requeue state mode

When a job is requeued, call deallocate_nodes() with a job state
if COMPLETING. Previously it was called with a state of JOB_REQUEUE,
which could be problematic for step complete function calls (which
I am working on fixing now).