Fixes EPERM error on Windows on rename by writing to output file on callback