Assume shouldn't behave different at the call site depending on build flags. Currently compilation fails if it is used as expression. Fix that by using the lambda approach from Assert() without the assert().
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/2113317 | core#21137317]]