Optimized the upgrade tool

As far as I can tell, there is no good reason for the second line of the "tools/upgrade.sh" to be there. If escaping white space where necessary, that method would be insufficient. Worse, since the only later use of the variable has it in double quotes having backslash escapes for spaces actually breaks it.