The previous behavior, skipping some L3 DisconnectBlock calls,
but still attempting to reconnect these blocks at L4, makes
ConnectBlock assert.
The variable skipped_l3_checks is introduced because even with an
insufficient cache for the L3 checks, the L1/L2 checks in the same
loop should still be completed.
This is a partial backport of core#27009
https://github.com/bitcoin/bitcoin/pull/27009/commits/61431e3a57b5613d8715c93c6eae0058e0217eaa
Fixes core#25563.