Set correct error code when requeuing a completing/pending job

(Also remove extra pending check, no reason to check it twice ;))
When checking for if dependency of type afterany, afterok and afternotok
don't clear the dependency if the job is completing.
Cleanup the JOB_COMPLETING flag and eventually requeue the job when the
last epilog completes, either slurmd epilog or slurmctld epilog,
whichever comes last.
When attempting to requeue a job distinguish the case in which the
job is JOB_COMPLETING or already pending.
Fix test to work with job profiling

Job profiling leaves a file open
Fix to strigger test

Duplicate triggers are not not allowed
Merge branch 'slurm-14.03'

Conflicts:
	testsuite/expect/test7.9