ez_setup.py: fix str/bytes mismatch

This file reads itself in the update_md5 function in order to to update
the md5_data dict. The file contents are then matched against a text
regex, so the file has to be opened in text mode to match. Otherwise
this mismatch will manifest as

    TypeError: can't use a string pattern on a bytes-like object

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 unused imports and use open() calls as context managers.