Stop user agent in a background thread.

- Issue #49