job/valgrind: Fix invalid reads/missing free.

The JobEvent structure may refer to a job after it has been freed. Apply
@tarruda's patch to extract the job data before pushing the event.

Also, fix the type, "data" -> "job", in on_job_exit() and free the job
name in the last job event.
job_start: Do not close in/out/err on error.

The streams job_close_*() reference have not been initialized by the
time we call uv_spawn() and libuv closes these pipes for us when spawn()
fails.
test/shell: Add failure tests for `system()`.
test/job: Implement some basic jobs tests.
Merge PR #1350 'valgrind/jobs: Fix invalid reads.'