newlocale and freelocale

Stuff in libcxx gets upset when ``newlocale`` returns a NULL pointer.