Added error handler for stdin and stdout.

I have unhandled stream errors in my tests recently. Something to do with concurrency, the PNG is deleted just before or while launching `pngquant`, which breaks the whole test suite because the error isn't treatable.

This patch properly adds an error handler on the process' `stdin` and `stdout`, making these kind of errors treatable for the caller.