Replaced getWaitingWorkers with tryGetWaitingWorker

This way I can change the underlying data
structure without impacting user code.