ez_setup.py: fix str/bytes mismatch

The only problem here is when this file reads itself in the update_md5
function in order to to update the md5_data dict. Since this file is
entirely ASCII, it's safe to read it in text mode without specifying an
encoding.

While I was looking at it, also do some other cleanups/style tweaks:
drop some unused imports and use open() calls as context managers.