fix loop logic cruft in dynamic tls installation