Extension of the node.js path.extname method.