Clean up pthread_create() error handling