Fixes a bug in client teardown by moving the event buffering thread to someplace more sensible