Fix pend_list insertion logic

The for_each only will insert if the new item is before an existing item.
If the new item is after all existing items (or there are none), add to
tail.

Signed-off-by: Andy Grover <agrover@redhat.com>