fix: unused `let_fun` elimination in `simp`

This PR fixes a bug in the simplifier. It was producing terms with
loose bound variables when eliminating unused `let_fun` expressions.

This issue was affecting the example at #6374. The example is now
timing out.
2 files changed