EA-31437,IDEA-121511 - assert: DocumentFoldingInfo.writeExternal

following review #300
console leak fixed