Fix a potential deadlock in helper_do_stat()
pthread_mutex_lock(), pthread_cond_signal() and pthread_mutex_unlock() are
not async-signal-safe and hence must not be used inside a singal handler
implementation. Rework the code for communication with the helper thread
such that it becomes async-signal-safe.
Compared to commit
31eca641ad91, tests for the pipe() and pipe2() system
calls have been added and a pipe simulation for Windows has been added
(pipe_over_localhost()).
Fixes:
a47591e4923f ("Improve logging accuracy")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>