[DF-5073] Fix getting string size for strings with '\n' symbols