Introduce circuit breaker middleware

Circuit breaker watches the error condtion to match, after what it activates the fallback scenario, e.g. returns the response code.
Is this lock needed for anything other than `setRecovering` and `setState`? If not, can grabbing it be moved inside `setState`?