Fixed critical mistake in mbrtowc.
The state should not be preserved if mbrtowc converts successfully.
Fixed minor mistake in strrchr (wouldn't be able to strrchr '\0').