Make use of isalnum() safe in case isalnum() is a lookup table.
Fixes build with Clang on NetBSD.