Use modifyTVar' in preference to modifyTVar.

Fixes a thunk leak in `Client` where the `failures` counter is rarely
read and a lazy `modifyTVar` accumulates thunks over time.