Make sure stdout/stderr are fully drained before exiting a test

Ugly ugly hack workaround for node bug in Windows.

I don't know how to test this really. There are other tests that actually fail before this fix so I guess it's kindof alright to go without extra tests.

Closes #61