[client][managed] refactor ProcessQueryAsync to allow mocking #374