OFString: Improve freeWhenDone in case of error