Fix another seac regression (issue 4801)

This is a ***very*** tentative attempt at fixing #4801. (It's by far the ugliest hack that I've ever submitted for review :-)

The proper way to handle these kind of issues is probably a much more invasive re-factoring/re-write of the entire seac analysis, but that's unfortunately beyond my ability.
Given that the issue that this PR fixes is a regression, I think that it makes a certain amount of sense to accept an (ugly) workaround for now. (If the issue wasn't a regression, I wouldn't even have bothered with this patch.)
Split this function into `getCharCodes` and `createCharCode` to avoid the addMap parameter and related branching. Also, don't create charCodes until needed, e.g. you can initialize it with null and create when the first code is found.