Configure on HAVE_TCHAR_H to fix build on cygwin

Cygwin does not have tchar.h, so in that case fall back to just use a
plain char type.