hashmap: Iterators for hashset diff, sym. diff, intersec, union

Implement the difference, union, etc iterators with the help of a custom
iterator combinator with explicit closure environment. Reported issue #7814
to be able to use the std::iterator filter combinator.