Allow file contents to be strings

Some gulp plugins (eg. [gulp-coffee](https://github.com/wearefractal/gulp-coffee)) replace the file contents with a
transpiled string. This fix writes string contents to disk the same way it would be written if it were a buffer.