node-api: handle pending exception in callback wrapper
fixes: https://github.com/nodejs/node-addon-api/issues/1025
The functionreference test from the node-api tests was reporting a failed v8 check when Node.js was compiled as debug. The failure was because an exception was pending but the C++ wrappers were returning a return value that was invalid.
Signed-off-by: Michael Dawson mdawson@devrus.com