make _socket.socket weakrefable (closes #22569)

Patch from Alex Gaynor.
3 files changed