std: Re-optimize tls access on local allocation path

I did this once but acciddentally undid it in a later patch.
auto merge of #8487 : brson/rust/local-opts, r=brson

I did this once but acciddentally undid it in a later patch.