Eliminate a use of a ctype.h function.

That way, we avoid locale-dependent behavior.

Change-Id: I429fde961dc7cb61013756a663d6cd511f19ca70
Reviewed-on: https://code.wireshark.org/review/4845
Reviewed-by: Guy Harris <guy@alum.mit.edu>
(cherry picked from commit 4d6b3db5d4edc8743151c599330441ad2f943094)
Reviewed-on: https://code.wireshark.org/review/4846