Fixes a bug that would cause havoc if the temporary directory was set to be a (super directory of) the job directory.