Replace sys.exit by a RPCException

This change replace sys.exit by a RPCException like the zmq
implementation does, to allow library users to handle the case of the
rpc failure in their applications.

Change-Id: Iafda7bfa20840fa5488dece1d5ad49e2b14b73b5
Merge "Replace sys.exit by a RPCException"