fix unexpected potential GPF issue in TTextWriter.WriteObject()
- can be triggered e.g. when an Exception is logged