Made tornado test server thread safe.

`add_callback` is the only thread-safe operation.