Make scanr a good producer and consumer

This fixes #9355.
Make mapAccumL a good consumer

This fixes #9502.