Fix unit tests for Python in a twistd instance