Make scanl-detection tolerant against deeply nested let-expressions.

Enabling more let-floating in the compiler will cause it to generate inefficient code for calls to scanl; this patch makes the compiler more tolerant to nested lets.