count only leaf nodes of toc tree when level is zero

This patch implements collecting TOC ticks of only leaf nodes proposed in https://github.com/koreader/koreader/issues/976#issuecomment-58483192.