Updated runtests.pl to support Windows

`waitpid()` is required because otherwise Perl on Windows might fail after 64 or 128 tests.
Removing `\r` from both test output and generated output enables both spec.txt and the generated results to contain Windows newlines (`\r\n`).