Put tasks at the back of the only if there is at least one available worker.

This will avoid unnecessarily putting tasks at the back when there are no
connected or available workers.