Add some sytem locale utilities to libphutil


Add some sytem locale utilities to libphutil

Ref T13060. Ref T7339. Ref T5554. Although I don't plan to pursue resolving the latter two issues for now, I think we do have enough information to be confident that setlocale() is the ultimate pathway forward.

Add some wrappers with error checks and unit tests for the day that we eventually tackle T7339/T5554, and so we're on better footing if the setlocale() change in T13060 has unintended effects.

Test Plan: Ran unit tests, got a pass.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13060, T7339, T5554

Differential Revision: https://secure.phabricator.com/D18990