fix for _IO_lock_ funcs crashing on TLS reference