adding pthread_exit wrapper