Safe implementation of String#intern