string_decoder: refactor encoding validation
As far as I can tell, I couldn't find a valid reason to call normalizeEncoding and isEncoding for the same input. Normalize encoding function returns undefined if the encoding is not valid.
Benchmark ci: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1640/