client: Refactor view checking for operations.

This commit introduces a new abstraction for operations that can result in an
InvalidViewException. Each of those operations will be encapsulated by an
executor function which checks for InvalidViewExceptions, renews the view and
retries the operation.