crt: fix return value of mbrlen and mbrtowc functions with DBCS code pages

CRT's mbrlen and mbrtowc functions return incorrect value if
previous call to either of them has returned (size_t)-2 when
converting using DBCS code page.

Previously, mingw-w64's implementation of those functions was
implementing the same buggy behavior for compatibility with CRT.

This commit fixes return value of mbrlen and mbrtowc functions.
Tests for mbrlen and mbrtowc functions are updated accordingly.

Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
3 files changed