Logging - If valid, then set a locale
This is an updated variation of Seamus's 27974, with two key differences:
1. It calls `setLocale()` one time -- from within `createDebugLogger()`.
(This becomes an internal detail of how `createDebugLogger()` works.)
2. It calls `setLocale()` conditionally -- if the method actually exists.
It's not certain whether the method will ultimately be part of the
official `pear/log` releases. (*And once upstream changes, it may
immediately affect D9/D10-style builds.*) This change means that
civicrm-core should with `pear/log` in either contingency.