Handle deriving locale from OS X SSH remote client in a safer way.