Ensure the thread keys are always allocated in the same order