config: get_multivar -> get_multivar_foreach

The plain function will return an iterator, so move this one out of
the way.
config: move next() and free() into the iterator

Like we have in the references iterator, next and free belong in the
iterator itself.