For lowercase referral codes we normalize them to uppercase. When stripping the referral code from the filename, that means we need to do a case insensitive replacement. We use perl instead of sed because macOS uses BSD sed, which doesn't support the "i" flag for regex. Fixes https://github.com/brave/brave-browser/issues/9785