Convert StringIO's state record into a map.