python's NamedTemporaryFile hardcodes a mode of 0600, which is wrong
for what we are trying to accomplish. Downloaded files should be
created with default permissions (respecting umask, acls, etc.)
It's a real pain to fix up permissions after the fact so we'll
have to cook up our own version instead...