Pass errors='replace' to io.open