Allow error writing to process non-Grace objects

The toString helper in bin/write assumed that its argument was a Grace
object, but it was being passed objects such as strings as well. Now it
checks to see if its argument is a Grace object and performs a normal
toString if it is not.