Replace codecs.open with io.open to fix Windows.

codecs.open will not work in Plex under Windows. Using io.open instead.