Fix bugs in C2PAP part.

Change the way the submission of jobs is done to ensure that the deletion of
the temporary file does not crash the job. Also remove a debug printout which
was overlooked before.