asyncio: Fix _ProactorWritePipeTransport._pipe_closed()

Do nothing if the pipe is already closed. _loop_writing() may call
_force_close() when it gets ConnectionResetError.
Issue #17162: Add PyType_GetSlot.
Issue #17162: Fix compilation, replace non-breaking space with an ASCII space
Close #20404: blacklist non-text encodings in io.TextIOWrapper

- io.TextIOWrapper (and hence the open() builtin) now use the
  internal codec marking system added for issue #19619
- also tweaked the C code to only look up the encoding once,
  rather than multiple times
- the existing output type checks remain in place to deal with
  unmarked third party codecs.