Unsafe listification of weakref in Python < 2.7.4

Before Python 2.7.4, WeakSet [has a bug where `__len__` is not safe](http://bugs.python.org/issue14159) and refs may be removed from the underlying set during execution.

As it turns out, `list()` apparently calls `__len__` to preallocate storage (if it's available), which can trigger the bug (#966). This proposal wraps the WeakSet in `iter()` to make `__len__` invisible.

Although looking at [WeakSet's iteration code](http://hg.python.org/cpython/file/b6acfbe2bdbe/Lib/_weakrefset.py#l58) there seems to be a guard to prevent removal of items during iteration. That guard was there [from the original backport of WeakSet](http://hg.python.org/cpython/file/04cc075bddf5/Lib/_weakrefset.py#l58), so maybe we should just remove the `list()` call altogether and do bare iterations on `env.all` (in which case we could fold this in #970)?

@rco-odoo