C++ Client. Use the object `io_service::work` to prevent io_service running out of work.

- Deleting the `work` object to permit the io_service to exit.
- Also reset `io_service` before submitting query.