Fix memory leak detected in PR 1510.

LSAN/ASAN detected, on an error code path, that not all elements of a
struct ChannelCallFrame were freed.
channel.c: Fix for heap-use-after-free

ASAN detected this heap-use-after-free.
A job started by channel_from_job() could terminate and result in a call
to free_channel(), while channel_send_call() was still active/pending
and accessing Channel elements.

Original patch by @tarruda.
Merge pull request #1534 from oni-link/fix.leak.detected.in.1510

Fix memory leak detected in #1510.
term/ui: Add new ui.c module and "abstract_ui" builtin termcap

Implement a builtin termcap based on the old gui. This is how Nvim behaves when
the "abstract_ui" termcap is activated:

- No data is written/read to stdout/stdin by default.
- Instead of sending data to stdout, ui_write will parse the termcap codes
  and invoke dispatch functions in the ui.c module.
- The dispatch functions will forward the calls to all attached UI instances.
- Like with the "builtin_gui" termcap, "abstract_ui" does not contain any key
  sequences. Instead, vim key strings(<cr>, <esc>, etc) are parsed directly by
  input_enqueue and the translated strings are pushed to the input buffer.