Hook transformer should verify filename argument

The transformer function always calls `path.resolve` on the filename argument of the code under consideration. However, the filename argument to `vm.runInThisContext` is optional, and `vm.runInThisContext` doesn't verify that it's a string (which `path.resolve` requires).

This PR includes updated unit tests along with the change to `lib/hook.js`.