Don't use ctype.h routines.

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

Change-Id: I189222eff624ad2d2e960bc0b69f3f22d35f351f
Reviewed-on: https://code.wireshark.org/review/4787
Reviewed-by: Guy Harris <guy@alum.mit.edu>
(cherry picked from commit 5fc398c3286fda408ad5cd4b5834d1b2778db86a)
Reviewed-on: https://code.wireshark.org/review/4788