Ticket 49887: Clean thread local usage
Clean the thread local usage of the logging system to be more inline with
pthread's intent, remove bad practices of case/switch get setters, and change
the types to be more effecient struct types. Generally make it better
https://pagure.io/389-ds-base/issue/49941
Author: William Brown <william@blackhats.net.au>