[JBERET-108] It hangs if the partition plan defines the number of threads as 0

When the partition plan is defined the number of threads
are checked. If it's 0 then the number of threads is equal to the number
of partitions.