Use built in next() function in misc test_*.py

Under Python 3 need to use next(iterator) rather than
iterator.next(), and this built in function is new in
Python 2.6 (so we couldn't use it until we dropped
support for Python 2.5).