test: Remove most uses of `&fn()` from the tests.

r? @alexcrichton