Added a fix for crash when incorrect LC_CTYPE is sent via ssh from Mac OS X