fix pthread_key_create memory leak
big endian check