vim-patch:7.4.226

Problem:    Cursurline highlighting not redrawn when scrolling. (John
            Marriott)
Solution:   Check for required redraw in two places.

https://code.google.com/p/vim/source/detail?r=b650f2db8f9604124c0ddfb14af0c04bd4ae0580
Deal with backpressure on RStream instances

Each RStream instance will now stop its libuv watcher when the buffer is full,
and automatically restart when some data is read with `rstream_read`.
Create EventType for RStream reading

RStream will be the main way Neovim receives asynchronous messages, so it is
best to have a specialized EventType for it. A new flag parameter was added to
`rstream_new` which tells the RStream instance to defer event handling for later
with KE_EVENT instead of handling it directly from libuv callback.
Refactor job control to use RStream events

Instead of a single 'job read' callback, job control consumers need to provide
callbacks for "stdout read", "stderr read" and "exit". For vimscript, the
JobActivity autocommand is still used to handle every job event, for example:

```vim
:let srv1_id = jobstart('netcat-server-1', 'nc', ['-l', '9991'])
:let srv2_id = jobstart('netcat-server-2', 'nc', ['-l', '9991'])

function JobEvent()
  " v:job_data[0] = the job id
  " v:job_data[1] = the event type, one of "stdout", "stderr" or "exit"
  " v:job_data[2] = data read from stdout or stderr
  if v:job_data[1] == 'stdout'
    let str = 'Message from job '.v:job_data[0].': '.v:job_data[2]
  elseif v:job_data[1] == 'stderr'
    let str = 'Error message from job '.v:job_data[0].': '.v:job_data[2]
  else
    " Exit
    let str = 'Job '.v:job_data[0].' exited'
  endif

  call append(line('$'), str)
endfunction

au JobActivity netcat-server-* call JobEvent()
```

And to see messages from 'job 1', run in another terminal:

```sh
bash -c "while true; do echo 123; sleep 1; done" | nc localhost 9991
```
Correctly free libuv handles

This ensures memory chunks for libuv handles are only freed after the event loop
no longer has references to it.
Extract writing boilerplate into wstream.c module
Refactor job.c module to use WStream

After a job has accumulated 1mb of stdin data we assume that it's stuck and kill
it.
Stop job prepare watcher when there are no jobs

No need to check for job status when no jobs are running