Polyfill the connectProtocol to fix compatibility with Twisted 12.2