Fixed check for pending tasks

Goal was to move ready tasks to the end of array.
Existing coded did opposite.

Also movable types can be invalid in the second part of the array after
applying remove_if.

BUG:24204632
Change-Id: I9be84fa8f536337a265c1e24cc75036c7fca8dbb
Reviewed-on: https://weave-review.googlesource.com/1500
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
1 file changed