Prefer to SHA1 other than MD5 in third-party downloads

If CMake version is less than 2.8.11, fallback to MD5
Merge pull request #1414 from xu-cheng/sha1_md5

Prefer to SHA1 other than MD5 in third-party downloads
job: Only force-close stdout/stderr when the job exits

stdout/stderr should only be closed after the job truly exits, or else we can
lose data sent by it.
Homebrew: let Homebrew handle external resources download
build: don't download and extract tarball if source is already present

When building under Homebrew, we want to let Homebrew manage downloading and
extracting the tarballs.
Merge PR #1424 'Only force-close stdout/stderr when the job exits'
Merge pull request #1411 from xu-cheng/homebrew-formula

Let homebrew handle external resources download
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.
job: Let vimL jobsend() accept a list.

Use save_tv_as_string(), same as vimL system(). This also makes
jobsend() more liberal in what it can accept. For example,
`jobsend(j, 123)` is now valid.

Closes #1176
job_spec: Fix bad test.
Merge PR #1255 '[RDY] Set `v:job_data[2]` line-wise and `jobsend(,[list]). (#1243)'
msgpack-rpc: Return from msgpack_rpc_validate on error

- When validating a msgpack msg we need to return on the first error
  otherwise we can SEGFAULT with invalid checks
msgpack-rpc: Fix typo in validation message
msgpack-rpc: Don't try to write into a closed channel
msgpack-rpc: Close channel on invalid msgpack RPC

- When an invalid msgpack RPC msg is received from a channel
  we now close that channel all calls on that channel fail with
  an error message.
Merge PR #1399 'Better handling for invalid msgpack-rpc'
Fix warnings: ex_cmds.c: do_ascii(): Garbage value (2): MI.

Problems   : Assigned value is garbage or undefined @ 127.
             Assigned value is garbage or undefined @ 152.
Diagnostic : Multithreading issues.
Rationale  : Error could only occurr if global `enc_utf8` changed while
             the function is executing.
Resolution : Use local copy of global var.