json_rpc_remote.close(): close before clearing