Switch to thread local storage from cutils.