Rather than another threadlocal, why not just piggy back off of context/_local.get_local_context?  It should would just fine for this purpose.