This makes the WithContext patcher work when passing in a struct for an
env that has methods that take a context.
This is a bit fiddly because we can't quite detect the difference of
function vs. method on a struct, so we have to check both the first and
the second param. Since it's highly unusual to pass the context as
anything other than the first parameter, this should work out just fine
in practice.
Fixes#600.