Remove some stray uses of <ctype.h> functions.

These are causing assertions on some MSVC builds.