fix(util): properly handle exceptions from onPrepare and onExit

p.s. the important bit is in `runFilenameOrFn_` in `util.js`