Update readme example to correctly handle files

As per the documentation in to.js, it is incorrect to rely on the 'end' event when writing to a file.  Utilize 'close' instead.
Merge pull request #94 from chuggins/master

The example on the readme is slightly incorrect, and will result in intermittent failures.