Upload even if JOB_FAILED

Adding code to check two flag files: the usual READY_TO_UPLOAD.txt and the new one JOB_FAILED.txt

If JOB_FAILED.txt, upload the files on XNAT (to see the outputs and outlogs) and leave the status to JOB_FAILED.