slurmstepd code reorganization

Cray needs for task_g_post_step() to be called before resetting
the CPU frequency. We also need to reset CPU frequency before
notifying srun of task completion. Logic reorganized to satisfy
this requirement
see bug 1011