Add thread safety to ThreadsafeSettings.