portability: fix problems compiling with C++ compiler
Michael McConville suggested removing a "redundant" cast of
the return value from malloc(), based on a change in the
OpenBSD version of unifdef. This is a good suggestion for
a purely C program, but the cast is required in C++.
Carsten Hey contributed some portability improvements in
2012 which included this cast, so that unifdef can be
compiled with a C++ compiler. Unfortunately since then
there have been several regressions in C++ support.
This commit fixes those regressions.