Fully expand entities to ensure deep or widely nested ones fail parsing

With 512a1ce0698d370c313bb561bbf078935fa0342e, we failed when parsing
entities whose partially expanded size was greater than 1024
characters. That was not enough, so now we fully expand all entities.

This is a backport of f1053d94f59f053ce4acad9320df14f1fbe4faac.

Change-Id: I41dd6f4525c63e82fd320a22d19248169627f7e0
Reviewed-by: Richard J. Moore <rich@kde.org>