ENH: add close method and context manager support to IO