Adding a uniform 'shutdown' mechanism for closing JSON-RPC clients and servers.