Fix blocking rpc requests

It was possible to return from blocking rpc requests without a response, this
was fixed with some refactoring in client.py and rpc_stream.py