Fixing DistCopy - flush stream before moving tmp file

@raronson @charleso 
Just curious - does the `close()` not do the flush anyway?