XWIKI-11424: The tree pagination doesn't work if links=true

(cherry picked from commit a29afcc3c704e00fcdb7d978c11f5f22edb7a486)
[misc] Don't show the open/close/leaf icon when the node is in the loading state.

(cherry picked from commit 3079dfd4203599572265c9a436018b6860b9f20d)