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 033f096ee909b63c0692b80416797f743940d054)

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