XWIKI-10290: Empty HQL query throws exception

(cherry picked from commit ab50b71449d19e2eef9e09ce620fb512875a6e0e)