[install script] Refactors NVM_DIR

After the PR:
* Uses a function to define the install dir (aka `NVM_DIR`)
* Does not replace an empty yet defined `NVM_DIR` variable, but uses a default value instead
* `NVM_DIR` is used at a single point in the install script

Isn't it better then that we unset it at the end of the function?

I've struggled to decide whether (not-environment) variables should be uppercased (as per the rest of the script) or lowercased (as per the accepted scripting conventions).

`ksh` is an edge case here. It should not be neglected, but maybe nvm could stick to the shell scripting conventions by usig lowercase for local variables _and_ yet explicitely unset them for ksh.

It's mostly aesthetics, but it could help regular script writers to "feel home" quickly, and will leave ksh users with a cleaner environment, which could avoid bad side-effects at the same time.