make thread killlock async-signal-safe for pthread_kill