[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.