Cast malloc to wchar_t. This is required in C++.

This.

Fixes issue #12543