Distinguish connection/request failures
Try to ensure that rpc server stop sends response

Note that this works in practice, but it might be cleaner to incorporate
this sort of functionality in the http server itself if it doesn't exist
already.  Essentially we just sleep long enough to respond before
shutting the server down.