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