Don't use ctype.h routines.

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

(cherry picked from commit 033f096ee909b63c0692b80416797f743940d054)

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