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 a91799ebfa3a3aac705132722e57acc92fe4eddb)

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