Only consider impliciy unboxed closure impl if the obligation is
actually for `Fn`, `FnMut`, or `FnOnce`.

Fixes #18019
auto merge of #18022 : nikomatsakis/rust/issue-18019, r=pcwalton

Only consider impliciy unboxed closure impl if the obligation is actually for `Fn`, `FnMut`, or `FnOnce`.

Fixes #18019

r? @pcwalton