Do the configuration pruning only in the DISABLE_UI case

Change-Id: If85c6a86434c0aa32d188a0f128f6b6cd613bbb5
We seem to crash unless we have org.openoffice.Office.UI/Factories

Change-Id: Ie172f60a7134173462ff9711a40dc74c94ad8206