Proper handling when pkg.main points to a directory.

This is a fix for #22, in which a package has a dependency, and that dependency has a `pkg.main` property that points to a directory rather than a file.

This includes the same one-line fix as #24, and also includes a test case (which would fail without the fix).

See also: https://github.com/shtylman/node-browser-resolve/issues/27