Fixed a bug in the multithreading "dispatcher" (apparently the Numba official docs contain broken code...)

The multithreading code in the examples from the official Numba docs is
broken, apparently. The chunking of a list of tasks into subsets of
tasks sometimes left some of the tasks uncompleted.