improve node module validation

This patch should fix mapbox/node-pre-gyp#46 unless I missed something.