Fix a file extension duplication bug

This problem happens when a module name already has a file extension.
A module name with the file extension should be accepted.
See the [CommonJS modules specifications](http://wiki.commonjs.org/wiki/Modules/1.1#Module_Identifiers).