Fix problem where a thread can go idle even if there are handlers that are ready to be dispatched.
Remove need to have a mutex per idle thread.