Cache string constants in CodeGen

Prevent emitting ridiculous numbers of identical error message strings.