This class encapsulates all the logic and operations required to correctly bridge an async operation into a sync function. In particular, it also makes it less easy to forget to check if the io_service exited because it was stop()ped.