LP#1185701: fix spurious XMLSyntaxError after finishing iterparse()