Fix for incorrect LC_CTYPE sent from OS X via SSH

This fix is maybe somewhat too specific, since it first checks if LC_CTYPE is set to "UTF-8".

I tested this on several systems, and it does solve (kind  of) the problem. Basically, if ``locale.setlocale(locale.LC_ALL, '')`` fails,  it calls the following instead:

```
locale.setlocale(locale.LC_ALL, ('en_us', 'UTF-8'))
```

'en_us' and 'UTF-8' are derived from LANG environmental variable, which is specific to remote Ubuntu system.