Fix incompatibility with older Twisted version in tests. Thanks @OlegGirko!