Closing RPC connection in case of failure.