cast to unsigned char for each use of isspace

alternative to #7456, fixes #7303

cc @JeffBezanson @vtjnash