fixed bug of cc_utf8_to_utf16() when length!=-1

cc_utf8_to_utf16 doesn't work correctly if length!=-1 and the given char* is not zero-terminated or contains zero.
Why not use `length` any more? That will cause a lot of memory copies, since strings are not 0-terminated in many cases.