Eliminate a use of a ctype.h function.

That way, we avoid locale-dependent behavior.

(cherry picked from commit 4d6b3db5d4edc8743151c599330441ad2f943094)

Change-Id: Iabafc8e9e66f8c0cad6c53cc8aa36cc9454ef37f
Reviewed-on: https://code.wireshark.org/review/4847
Reviewed-by: Guy Harris <guy@alum.mit.edu>