Worker: Added option for maximum threads that are started; changed handling of thread negotiation from random numbers to job pids and considering the started threads
(cherry picked from commit 1854497ec3334827f988f0806cf8723d91674468)

Signed-off-by: Marc Hillenbrand <hillenbr@kph.uni-mainz.de>