Infer argument types for unboxed closures by inspecting the expected type

This also lays the groundwork for a simple version of inference to decide on `FnOnce` vs `FnMut` etc.

Fixes #17907 

r? @pcwalton