Optimise some case argument in v3_core

If the argument of a case expression is a let, a seq or a case with two clauses
where the second one is a failing clause; it can be moved outside the case and
further optimisations can be performed.