Fix type annotations to be compatible with new annotations in development versions of twisted.