Refine executor's get_work.

It uses the random number generator again, and also doesn't hit the global
queue too often, as it should be rare that things go into the global queue.