ez_setup.py: remove fallback md5 import

hashlib ships with Python 2.6.
Replace three more dict.keys/items occurrences

It's easy to forget that these calls produce lists in Python 2, but 2to3 makes
it very clear by converting e.g. dict.keys() to list(dict.keys()). If we don't
need an actual list (and we rarely do), may as well just use iterators.

In ez_setup.py, we can obtain the first 10 keys with itertools.islice.
Use __future__.print_function import

This is valid in Python 2.6, and reduces some of the code churn that occurs
with 2to3 conversion.

Also replace the old "except Exception, e" syntax.
Use another open() call as a context manager