Fix thread safety issue on texture pack lazy initialization