config: introduce _iterator_new()

As the name suggests, it iterates over all the entries
config: introduce a regex-filtering iterator
config: implement _foreach and _foreach_match on top of the iterator directly

Use a glob iterator instead of going through
git_config_backend_foreach_match. This function is left as it's
exposed in the API.
config: handle empty backends when iterating
config: deduplicate iterator creation

When the glob iterator is passed NULL regexp, call the non-globbing
iterator so we don't have to special-case which functions to call.
config: get rid of a useless asignment