Fix chatserver.py to work on twistd daemon mode