fix regression in dynamic-linked tls when both main app & libs have tls