Re #8487. Put include in right place to make Windows happy.

Also clear up a few unused headers.
Merge branch 'bugfix/8487_geometry_poco_xml_leaks' into develop