Otherwise, it wouldn't compile with at least /bin/cc on ymp-cray-unicos9.0.2.X. Combine two mostly-identical uses of alloca into one.
(defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H). It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1 reported by Vin Shelton.