Don't use ctype.h routines.

That avoids locale dependency and handles possibly-signed chars (which
we weren't doing before).

(cherry picked from commit 5bfde7c6386b56db80fec85e2ca7dc1d271b461c)

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