fix #1143 mocha tests failing on patch builds

New versions of npm (1.4.x) transform the version entry in package.json
from the form like `1.4.17A` to `1.4.17-A` in the env variable.

Hence our build was failing on patch builds when new version of npm was used.