SI-7399 : Take scala.concurrent.context.maxThreads into account

This change fixes the bug whereby specifiying maxThread as a property
has no effect. A small refactoring is applied in the process.