Do not replace stdout in child worker process.

Unidentified spurious problems on Solaris 9, with file descriptor 0
*not* corresponding to stdin, triggered me to change the worker child to
not close its stdout and replace it with the dup()ed pipe
descriptor. Instead, it now fprintf()s directly to that pipe.

Didn't fix the problem on Solaris (still investigating) but still its a
good change.
(cherry picked from commit 3cc6d976795a200d92b36beca842de39ff28bde7)
pthread_cond_timedwait() takes absolute time

Also fix threads actually delivering the signal when they should.
This fixes test failure on Solaris.
(cherry picked from commit b3ba854eafbb5ee052f9a31538ca24d323b1a669)
Using high precision clock should avoid corner case...

where time(NULL) returns e.g. 5, but time is 5.99.
Thanks to @kacfengine for spotting this.
(cherry picked from commit f5fe3ee07e8e1b71a8df4f8c388bb5159160a153)