Replaced waitpid with waitpid_non_intr

Reported by Anders F Björklund.