fix deprecated Buffer.write call for node 0.11.x

Saw this popping up a bit using node v0.11.14:

`.write(string, encoding, offset, length) is deprecated. Use write(string[, offset[, length]][, encoding]) instead.`

Tested with node v0.10.33 and v0.11.14, using npm test.