XWIKI-9300: Velocity error when accessing search page with guest before any other user
(cherry picked from commit 5e1e6ca46eb40c7b82668794c55f0a01e32d4105)