Merged revision(s) 1617849 from poi/trunk: More cleanups for bug #56814 and some more external entity leaks of #56164