job/valgrind: Fix invalid reads.

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().
memory: implement xmemrchr()
rstream: Expose rstream_read_ptr and _available.

Needed for accessing this information without direct access to the
rstream_buffer.
job: Read job data line-wise.

Only read up to the last newline in push_job_event().
job: Make v:job_data[2] a list.

Factor out string_to_list() from f_system()'s implementation
and use that to set job_data. This has the technical advantage of
preserving NULs, and may be more convenient for users.

Required for #1176.