Fix arity of `write-to-file` method in text%

Found via TR. The two last arguments are supposed to be
optional but the method only accepted 1 or 3 arguments.