Fixing RangeError problem for large arrays

At least in Firefox, encoding large Buffers may fail because `Function.prototype.apply` has a maximum argument count and throws a RangeError when exceeded (To be precise, it is `String.fromCharCode.apply` what fails). My changes do fix that, though I am not quite sure whether it is the “best” way to do it… (at least, I don’t know exactly the difference in performance between `String.fromCharCode.apply` and a straightforward `for` loop).