job: Close libuv handles when uv_spawn fails

Commit @709685b4612f4 removed the close_job_* calls when uv_spawn fails because
of memory errors when trying to cleanup unitialized {R,W}Stream instances, but
the uv_pipe_t instances must be closed because they are added to the event loop
queue by previous `uv_pipe_init()` calls
job: Let job_start callers to selectively ignore stdio

Passing NULL as the callback for stdout/stderr will result in job_start ignoring
stdout/stderr, respectively. A 'writable' boolean argument was also added, and
when false `job_start` will ignore stdin.

Also, refactor os_system to allow passing NULL as the `output` argument.
shell: Rename dyn_buffer_t to DynamicBuffer

To follow our coding conventions
rstream: Add rstream_buffer method to get a reference to RBuffer
job/shell: Refactor os_call_shell/os_system to share code
job: Refactor how job kill timeouts are handled

Use a timer to periodically compare the current HR time against the HR time of
when `job_stop` was called. After 1 second, send SIGTERM, after 2 seconds, send
SIGKILL. The timer is only active when there's at least one `job_stop` call
pending.
job: Fix job_wait to properly cleanup the job when it exits.
Merge PR #1365 'Refactor os_call_shell to use os_system'