Fix a dangling reference to callback in chatdemo.py.
Merge branch 'branch4.0'