swarming: move code around to reduce function length.
swarming: move code around to reduce function length.

yield_next_available_task_to_dispatch() was very long and the query logic will
be refactored soon. Extract the inner part to make it more manageable first.

No functional change.

R=vadimsh@chromium.org
BUG=704236

Review-Url: https://codereview.chromium.org/2769313005

luci/luci-py,luci/luci-py,luci/luci-py,luci/luci-py