Improve test_wchar2utf8().

Currently it contains strange code like using `do` loop in order to
avoid `goto`s (they aren't evil, honestly), the pointless `if (mem)`
conditional which doesn't even work (had semicolon for some reason).

You may think this code had a bug where the code didn't check for
the pointer to be null before calling `free`, but this is not the case,
as according to C and C++ standard, `free` should allow `NULL` pointers,
and ignore them.
Fix NULL dereference when function name is not specified

It was possible to type `function ""; end`, and this caused fish to
crash because of NULL pointer.
Add test for empty function name.
Move the empty function test to tests.
Use parm_left_cursor and parm_right_cursor for bulk cursor motions.
Fixes #1448
Automatically add include paths for ncurses on Cygwin
Merge branch 'master' into death_of_fishd