XWIKI-10930: Delete and re-create a wiki (from a template) fails.

(cherry picked from commit 849133b0f8e57ccdc312fb54f29d0741f5bdf5da)