[Bug 52213] Thread crashes because pthread_exit is called in a signal handler