Correctly free libuv handles

This ensures memory chunks for libuv handles are only freed after the event loop
no longer has references to it.
Extract writing boilerplate into wstream.c module
Refactor job.c module to use WStream

After a job has accumulated 1mb of stdin data we assume that it's stuck and kill
it.