Properly visit nested functions and closures in check_rvalues

This correctly catches moves of unsized values in nested
functions and closures.

Closes issue #17651