Fix up type annotations to work with Twisted 21.7.