XWIKI-9912: Cannot repair the main wiki UI any more with the Distribution Wizard
* When testing if the previous UI has been successfuly installed take into account that it can be invalid due to the fact that one of its dependencies are not met anymore.

(cherry picked from commit a4d973d6c4b297c6451396cfffe88d79f1d275b3)