Properly handle redundant boolean clauses in sys_core_fold

Boolean case expressions with redundant clauses could make the compiler
crash:

    case X == 0 of
        false -> no;
        false -> no;
        true -> yes
    end.

Reported-by: Ulf Norell