Fix type error when `main` field points to a dir

In some npm packages (e.g., validator, superagent),  the `main` filed in package.json  file points to a dir (e.g, './lib'). When trying to resolve these packages, node-resolve will throw `TypeError: Cannot read property 'main' of undefined` because `loadAsFile` did not pass the `pkg` argument when falling through.