Fix a os.makedirs race condition in transcode().