This patch fixes the problem by explcitly creating the temp directory. File open operations in, e.g., hdfs, will auto-create the tmpdir. But in s3n, which expects an object with the name somename$folder$, this won't happen. As a result, the fullyDelete() call fails (silently) because the folder doesn't exist, even though there are objects with the tmpdir prefix in their object names.
I tested this patch manually by verifying temp dir creation during a distcp to s3n, and verifying that the temp dir object was removed at the end of the transfer.