s/cStringIO/io for Python 3 compability
Remove coredefs import in messages.py

coredefs.py does no longer exist. It has been removed with
28518d296cfa996fb9b95e6b0deafcf98bd93caf
Add missing (MIN_)PROTO_VERSION definitions

They got lost when coredefs.py was removed, but are still used by
messages.py.