Add code to handle when the test expression is neither true nor false.

Closes PR 14564.
I'm confused about how this actually accomplishes the goal. We seem to keep `thn` even when `takes-true` is `#f`, and to produce the full `if` expression if `(and (not takes-true) (not takes-false))`. But if your tests pass, it works, so I'm confused.