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: I9c91ea79d5313317e9a8a877b4ac806e96fdb38f
Reviewed-on: https://code.wireshark.org/review/4800
Reviewed-by: Guy Harris <guy@alum.mit.edu>