Fixing DistCopy - flush stream before moving tmp file

@raronson @charleso 
Just curious - where does this get closed?