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 5fc398c3286fda408ad5cd4b5834d1b2778db86a)

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