C99: Make _foreach() macros declare their iterators

The w_dict_foreach, w_list_foreach, and w_list_foreach_reverse will now
declare their local variable for the iterator, at the beginning of the
loop, like:

  for (w_iterator_t ...

This is a C99 feature.
Use (even more) static inline functions instead of preprocessor macros