XCOMMONS-670: ConcurrentModificationException during upgrading subwikis
* various bulletproofing

(cherry picked from commit bcd345f796169c0724b954f2964dca609877d7ea)

Conflicts:
	xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/test/java/org/xwiki/extension/repository/local/DefaultExtensionSerializerTest.java