Unless I misunderstand something here, this (very reasonable) suggestion isn't a concern here because we're only going to rename the file once we've written it.  It's not a 'tmp' file in the usual sense.  It's like when you download a large zip file -- the browser writes to a file with a non-zip extension, until it's ready, to keep you from clicking on it.