Modify `nvm_print_versions` while loop to for loop

Because, exit status becomes to 1 (error) always "while loop"