build: default to using -O2 for release builds

The -O3 optimization level can often lead to dangerous (and sometimes
incorrect) optimizations being performed.  So let's use a level that's
more stable.
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'
Revert "build: don't download and extract tarball if source is already present"

This reverts commit 90658982644b76a9e8e4abfbcd16450df26b0a32.

It failed to work correctly on a fresh clone.  See #1433.
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. See PR #1411.

Also make sure to skip only if directory is not empty. Fix #1433.
Merge pull request #1434 from xu-cheng/fix-1433

DownloadAndExtractFile.cmake: only skip if directory is not empty.
Merge pull request #1426 from jszakmeister/change-release-opt-default

build: default to using -O2 for release builds
CMake: Set custom RelWithDebInfo compile flags.
Merge pull request #1383 from fwalch/nvim-buildtype

CMake: Set custom RelWithDebInfo compile flags.
job: Fix memory leak in job_start().

If a new job cannot be started because no slots are free, we return early
without freeing the argv argument.