Remove rename (causing EPERM error on Windows)

Fixes #83 by writing directly to the output file rather than writing to a temp file and renaming it.