Fix segfaults caused by socket and io_service destruction order
Added async client tests, updated sync tests