Port twisted/scripts/trial.py to have a Python3 compatible syntax.

See https://twistedmatrix.com/trac/ticket/7154