fix json rpc server memory leak