fix DTD-API iteration of attributes in internal/external subset DTDs
merge lxml-3.2 branch into master