Python 3.2 support, and fix pthread_key_create()