fix MSVC-ARM internal compiler error by wrapping malloc

For some reason Microsoft CL compiler for ARM is unable to compile malloc when parameter is an expression. malloc(x * y) will cause internal compiler error, malloc(x) is however fine.