fix breakage due to initializing thread pointer when loading libs