Simplify logic around post-processing to avoid race conditions when moving files. Thanks to @mjafin. #642