ensure handleUnlock is called even for non-cached responses (#70766)
When a response is unsuccessful, we might still have acquired an
incremental cache lock and only realized we couldn't cache it after
receiving a non-success response code. `handleUnlock` is called in the
case of a successful response or a response received during a dynamic
render, but not in the case of an unsuccessful response. This adds the
missing `handleUnlock` for non-cached responses.
This used to be handled appropriately but was lost in some recent
refactors.
No explicit test case was added here as the reproduction in the failing
case was just a hanging build. So if the build passes and does not hang,
the test was successful. Validated it was hanging before implementing
this fix.