Set correct error code when requeuing a completing/pending job

(Also remove extra pending check, no reason to check it twice ;))