fix exceptions whitelist check on invoke using function pointer; fixes #2081