fix(hooks): Resource hooks shim doesn't work for callable classes

If a callable class is passed as a hook, rather than a standalone function,
the heuristic which determines whether or not to apply a shim for
backwards-compatibility with existing hooks does not take into account
that there may be a "self" param for the hook.

This patch modifies the heuristic to take callable classes into account.