Move sane_* routines to sane_ctype.c and fix some warnings.