Handle name prefixing in sanitizeGlobal/sanitizeLocal.

In the case of sanitizeGlobal, "_" was being prefixed in two different
places; this factors it out into one place.