Remove USE_CR and tag_fgets. #808

These features are only used by legacy Mac OS.
vim-patch:7.4.292  #754

Problem:    Searching for "a" does not match accented "a" with new regexp
            engine, does match with old engine. (David Bürgin)
            "ca" does not match "ca" with accented "a" with either engine.
Solution:   Change the old engine, check for following composing character
            also for single-byte patterns.

https://code.google.com/p/vim/source/detail?r=60cdaa05a6ad31cef55eb6b3dc1f57ecac6fcf79
vim-patch:7.4.290  #753

Problem:    A non-greedy match followed by a branch is too greedy. (Ingo
            Karkat)
Solution:   Add NFA_MATCH when it is already in the state list if the position
            differs.

https://code.google.com/p/vim/source/detail?r=b871734bf54ea185dbd2cc759d86dbfbe21cde26
text/encoding: constify arguments

Most of these functions don't modify their strings, let's make the contract
a bit clearer. In some cases I've tried to get rid of C89-style variable
declarations at the start of functions, now that I was there.
text: remove useless arg from mb_string2cells

mb_string2cells was always called like mb_string2cells(..., -1) so that was
the only codepath that was tested. @tarruda was the first to try to input an
actual length, after which valgrind detected that funny business was going
on.

It's not even possible to do the right thing with the current text codec
infrastructure: they all assume to be working with C strings. Meaning that
if there is no NUL-terminator, they will happily keep on reading past the
end of Pascal strings. Ergo, passing the length parameter is moot. The
condition in the for-loop was wrong as well (but that's no longer relevant).

Also change the return value to size_t, by analogy with strlen.

ref:
https://github.com/neovim/neovim/commit/677d30d7966dd2766bbf20665791c568dacc427a
Merge #777 'Constify text enc args fix mb_string2cells'
msgpack: NULL terminate incoming strings

It's a 1-byte loss of memory but it allows us to skip copying and
NULL-terminating strings when interacting with vim functions that accept C
strings. This lowers the pressure on the allocator and saves lines of code
(no more dup/free pairs).
api: remove some redundant string copies

Now that incoming Pascal strings are NULL-terminated by default, we can skip
some spurious copies.
api: also NUL-terminate Strings made from cstrs

I believe we can now mostly assume that all encountered String's data
members are safe to pass into functions that accept C strings. That should
simplify interop with C string code.
api: unify string conversions, simplify interop

- The data member of String's can now be passed directly to functions
  expecting C strings, as we now guarantee that they are NUL-terminated.
  This obviates the need to use xstrndup and free, simplifying code and
  enhancing performance.
- Use xmemdupz instead of xstrndup for converting String's into C strings.
  It's faster because it doesn't calculate strlen(string.data) (which is
  unnecesary as that information is already provided in string.size anyway).
- Use cstr_to_string to convert from C strings to String, it is both shorter
  and faster than the usual strlen/xstrndup combo, which calls strlen twice.
  cstr_to_string internally calls strlen and then xmemdupz.
Merge #783 'Nul terminate pascal strings'
deleted unused defines in vim.h  #772
Prevent null-pointer deference during vim_eval  #785

If the eval_expr call in vim_eval returns NULL, a null-pointer deference
would happen a few frames down, in vim_to_object_rec
Add function attributes to functions in memory.h  #811

Add missing function attributes in memory.h. Fixes #806
No OOM in dict_alloc() and rettv_dict_alloc()
No OOM in dictitem_alloc()
No OOM in hash_may_resize() and hash_add_item()

hash_add() can still return FAIL if the key already exists.
No OOM in dictitem_copy
No OOM in listitem_alloc()
No OOM in list_insert_tv() and list_extend()