Fix flags parsing in pkg_it_next.

Remove issue introduced with the previous commit. Flags should be
parsed from iter, not from function argument.