lib/npm-exec: fix windows issues

Remove string concatenation with path.sep where possible.

Simplify the algorithm for finding the root directory of the npm module.