Fix race condition where idle_loop() gets called from Split()

SplitPoint member slavesMask wasn't read under lock

No functional change.
Avoid locking/unlocking in a tight loop

After previous patch if split point master is
waiting for job and "Use Sleeping Threads" is
false (our condition for official releases) then
it will lock/unlock splitPoint mutex in a super
tight loop badly affecting performance.

Rewrite the code to lock only when we are about
to finish. Note that race condition on slavesMask
is anyhow fixed.

No functional change.