fixed potential random GPF in TTextWriter after Flush - see [577ad95cfd0]