Feanil/lock virtualenv

Fixes for permission issues while making virtual envs.

This also fixes the an issues seen with NPM when the registry is not explicitly set.